This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes java swing repaint Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "java swing repaint" Watch "java swing repaint" New topic

java swing repaint

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
Hi, I want to draw a picture in a JLabel. When I click the image, it will draw a rectangle on it, just like tooltip.

I have tried the coding below. But it doesn't work. I get the click position X / Y , and then call repaint() to draw a rect .


It is sorta covered in the JavaRanch Style Guide.
subject: java swing repaint
It's not a secret anymore!