Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java swing repaint

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Thanks

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic