This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv 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 REST with Spring (video course) this week in the Spring 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 .


I agree. Here's the link:
subject: java swing repaint
It's not a secret anymore!