how to refresh the client area

i used javax.swing.JPanel and drawed many shapes with paintComponent method. i wonder how to refresh the client area.

ps: i first used paint method to draw shapes, but i found a copy of the menu bar appeared. at last i found paintComponent method works, but when i tried to refresh the client area with repaint, the same scene appears.

could some one help me?

thanks in advance!

[405 byte] By [seablue1023a] at [2007-11-27 7:41:12]
# 1
> when i tried to refresh the client area with repaint, the same scene appears. When you invoke repaint() on a component, the paintComponent() method of that component is invoked. So unless your code in that method is different, the image painted will be the same.
camickra at 2007-7-12 19:21:47 > top of Java-index,Desktop,Core GUI APIs...