java - Swing UI not updating after using invokeLater -
I have a Java Swing UI that is not updating / reinstalling as I thought it should do the App XMPP message Sends and receives feedback on a different thread. This feedback is processed and the UI is updated to reflect the information given in the message.
When the response is received, I update a JPNL component using This has evolved from Java in a while ago, but on the basis of my research runonble up to execute online invokeLater queues GUI thread. However, my GUI does not update until I do anything in the app which causes painting - like changing the shape of a window, what am I losing? After the argument to update the panel, I have tried various combinations of invalid () and re-color (), but the result is still the same - the GUI does not update until I, no, the size of the window I change. Edit: When I say that to update the panel, I am specifically removing one, doing all () and then adding a handful of JLabels.
. SwingUtilities.invokeLater (New Runnabal) (Running Public Zero ()) / / Perform logic to update panel *}}};
After adding / removing components from a panel, you should use:
panel.revalidate (); // It works 99% of the time panel. Repaint (); // sometimes required
Valid (), invalid () etc. end up with the days of AWT, which I believe and re- Modified () works better and was specifically added for swing.
Comments
Post a Comment