File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Killing...removing object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Killing...removing object" Watch "Killing...removing object" New topic
Author

Killing...removing object

fwj vwj
Greenhorn

Joined: Dec 07, 2004
Posts: 1
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

Joined: Jan 14, 2004
Posts: 1535
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.
 
wood burning stoves
 
subject: Killing...removing object
 
Similar Threads
Switching b/w Frames
Problem in Jpopup Menu
lock -1
how to come back the previous screen
how to clear applet screen