How to repaint a JPanel after have drawn on it?

Try calling somePanel.revalidate(). That will tell the AWT that you have changed the component tree.

EDIT: Changed from invalidate to revalidate

Leave a Comment