I have a Java Swing UI that isn't updating/repainting as I thought it should. The app sends an XMPP message and receives a response on a different thread. That response is processed and the UI is updated to reflect information contained in the message.
When the response is received, I update a JPanel component using
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() { /* execute logic to update panel */ }
});
It's been quite sometime since I've developed in Java, but based on my research online invokeLater queues the runnable up for execution on the GUI thread. However, my GUI doesn't update until I do something else in the app that causes a repaint - such as resizing the window. What am I missing? After the logic for updating the panel, I've tried various combinations of invalidate() and repaint(), but the result is still the same - the GUI does not update until I, say, resize the window.
EDIT: When I say updating the panel, I am, specifically, doing a removeAll() and then adding a handful of JLabels.