Add a MouseMotionListener or MouseListener to each panel.
In the method
public void mouseMoved(MouseEvent e) of MouseMotionListener
public void mouseEntered(MouseEvent e) of MouseListener
add some sort of popup window with your text dsiplayed.
Frame popup;
public void mouseEntered(MouseEvent e){
if (popup == null) {
popup = new Frame();
TextArea textArea = new TextArea("Some text to display
like a tooltip.");
frame.add(popup);
frame.pack();
}else{
frame.show();
}
}
public void mouseExited(MouseEvent e){
if (popup != null) frame.hide();
}
There are all kinds of ways to do this.
You could make a class that extends MouseAdapter then override the mouse...
methods to do the above and then add an instance of it as a MouseListener
to the panel.