Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Repainting  RSS feed

 
Anirban dutta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can anybody please tell me that how can I repaint my Frame over which I have drawn through paint method by clearing the previously drawn images.
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can you tell us, what you want to do? Do you overwrite the paint method of the JFrame or some Component to display images? Do you use the mouse to display something?
Anyway, you can use the mouse event to ask for the current position and you can remember the last mouse position. Then you can calculate a rectangle. With it's help you can call the repaint method of your drawing component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!