This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Killing...removing object

 
fwj vwj
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I currently have an applet that displays a circle object on the screen when i press a button. Whenever I press the button again, it is suppose to clear any circles on the screen and draw a new one. But I can't seem to remove the first one, it just draws it on top of the other one. I'm using AWT. Is there anyway to clear an object off the screen? Thanks.

P.S. I've tried repaint(), but I don't know what else is there.
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you're doing. The Graphics method clearRect works good. If you are overriding the update method you can try super.update(g) to clear the drawing surface.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic