I'm making a GUI for the first time. I have to make a program that simulates an elevator system. I'm trying to resize a button to simulate the height that the elevator is currently at during runtime. The button size nor text will update until the loop is done and it returns. Is there any way to update this during runtime? Also, I'm open to other ideas. Thanks in advance.
Post by:Michael Dunn
, Ranch Hand
> The button size nor text will update until the loop is done and it returns.
no crystal balls here - post your (errant) code.
Post by:Rob Spoor
Read Concurrency in Swing. I'm 99% sure this is the cause of your problem - your loop is executed on the Event Dispatcher Thread (EDT), and therefore all updates to the GUI will wait until the loop is finished.
This thread has been viewed 870 times.
All times above are in ranch (not your local) time.
The current ranch time is Oct 20, 2018 03:21:35.