I have a main GUI class in which there are buttons and other controls when one of the buttons (say BTENGO) is selected , It is disabled and swingwalker (currently part of a different square) is started to do something.
I wish the button should be able again, the swingwalker ends.
How do my "hair class" (for lack of a better word) update a control in my main GUI class?
Pass the reference of the button to your swingwalker
sub-class constructor Then, in the .done ()
method, you can re-enable it.
.done ()
The method runs on the GUI thread, so this button can change the position safely. The
option is to register the button in the form of the PropertyChangeListener
as SwingWorker
, so that it can be notified when done.
Comments
Post a Comment