Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing JPanel with Java2D

Status
Not open for further replies.

TheObserver

Programmer
Mar 26, 2002
91
US
I'm using a JPanel along with Java2D to draw images onto the JPanel. I need to use this Panel in a GUI situation and be able to update the image shown within the JPanel in response to user events. However, it seems that once the JPanel has had an image drawn onto it, I can't draw a new on onto the panel and have it display - the old one remains.

Is there some sort of clear or other functionality I can use to clear off the JPanel so I can successfully draw the new image onto it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top