First of all, hi to all, this is my first post in this mailing list and I just registered because of a problem i'm having with Swing.<br><br>Well, I have a Panel inside a Frame which consists of a Canvas that I need to update in real time. Shortly, when you click on an option a different image must appear. <br>
<br>I have no problems on displaying the image, but when the user clicks another option, the old image doesn't dissappear, so the new one shows above the old one. I'm trying repaint, validate, removeAll, etc but nothing seems to work. <br>
<br><br>This is the code of the paintComponent() method on the Canvas class:<br><br><br>public void paintComponent(Graphics g){<br>super.paintComponents(g);<br>this.removeAll();<br>this.repaint();<br>(...) painting method (...) <br>
<br><br>...<br><br>}<br><br><br>Any suggestions? Thanks in advance<br>