Revalidate and repaint - Java Swing
- by bosra
I have a JPanel that I am adding JLabel's to. I then want to remove all the JLabels and add some new ones.
So I do the following:
panel.removeAll();panel.repaint();
panel.add(new JLabel("Add something new");
panel.revalidate();
This works fine. My problem arises when I start a new thread after this like:
…