The following code is what I have to try to paint a rectangle when ever I hover over a button. This rectangle will show a brief description of what the button will do. I'm doing something similar when pressing the help button and hovering over something a description in a rectangle shows up. But I cannot get the paint method to work. Can anyone tell me what I need to do to fix this.
public void mouseMoved(MouseEvent e) {
//System.out.println("asdf");
showMessage("Test");
}
private void showMessage(String string)
{
public void paint(Graphics g)
{
g.fillRect(25, 20, 20, 20);
g.drawString("Hello", 25, 20);
}
//System.out.println(string);
}