View Single Post
  #1 (permalink)  
Old 04-20-2008, 06:56 AM
gtraylo gtraylo is offline
Member
 
Join Date: Apr 2008
Posts: 2
gtraylo is on a distinguished road
Hovering mouse over a button and painting
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.
Code:
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); }
Reply With Quote
Sponsored Links