views:

800

answers:

2

i use the java repaint method , it repaints, but the update is only seen when I either click on the canvas or resize the panel. How can I fix this ? What causes it?

+7  A: 

You need to call the method revalidate(). This forces the layout manager to update / repaint all its components.

Develman
+1  A: 

repaint() isn't actually repainting, it's just requesting a repaint of the component.

Huxi