Originally posted by Gopu Akraju:
I tried myPanel.repaint(); tehn calling myPanel.validate(); and now it works. Is this the correct way?
I have seen many here use JPanel#revalidate() sometimes followed by JPanel#repaint(), but to be honest, I don't know what the canonical way to do this is.