I use the java repaint method, it redraws, but the update is visible only when I either click on the canvas or resize the panel. How can i fix this? What causes it?
You need to call the revalidate () method. This forces the layout manager to update / redraw all of its components.
repaint () does not actually redraw, it just asks for the component to redraw.
Graphics , . Graphics. :
g = component.getGraphics(); draw(g);