TheObserver
Programmer
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?
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?