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.
We should throw him a surprise party. It will cheer him up. We can use this tiny ad: