java - JDialog fails to pack(), only sometimes -


I have written a nifty thing in Java with a GUI that contains a JDILOG which starts with a small and then uses the pack () to render JDialog after adjusting the programs to be included later First of all this is happening.

Then, it is a surprise to me that when I run around 80% of the time, the window size fails to change. It seems completely random, because it is theoretically doing the same thing every time, why would you do something different with the same code after five seconds on the same machine on earth?

This problem, when I look for this GUI for native living and seems capable pop up

In my experience, when the GUI does this random odd stuff like this, it may be a symptom event Dispatch is not calling its GUI on the thread.

Ensure that all your GUI calls are wrapped in SwingUtilities.invokeLater or invokeAndWait with a non-GUI thread.

A quick Google search looks like a nifty method to check if your application meets the ADT rules:

Comments