Re: (newbie) How to get the UI to update right away




"mrstephengross" <mrstevegross@xxxxxxxxx> wrote in message
news:7f9ba402-e19a-4975-9d35-4b4b6fb4f19a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
So here's my next swing question: I've got a combo box with an action
listener. When you make a selection from the combo box, the action
listener fires off and does a bunch of stuff that takes a few seconds
to execute.

However! While the action listener is executing, the combo box does
NOT collapse. That is, I would expect it to first collapse (with the
new selection highlighted) and THEN fully executed the action
listener's code.

Is there a way to do this? I've been trying out various
implementations of the action listener to get it work, such as:

If you're going to do things that take a few seconds in the
EDT, then having the combo box stay open is a good way
to alert the user that some process is under way. Otherwise,
they will have no clue as to why the gui is frozen. You may
want to do anything that takes that long in another thread
though.


.



Relevant Pages

  • (newbie) How to get the UI to update right away
    ... When you make a selection from the combo box, ... listener fires off and does a bunch of stuff that takes a few seconds ... to execute. ... public void actionPerformed{comboBox.validate; ...
    (comp.lang.java.gui)
  • Re: JTable Key.VK_DOWN events
    ... The selection listener does work with this. ... > traverse the rows of the table usiing the down arrow key, ... > selection changes usiing the up or down arrow keys. ...
    (comp.lang.java.gui)
  • Re: (newbie) How to get the UI to update right away
    ... When you make a selection from the combo box, ... listener fires off and does a bunch of stuff that takes a few seconds ... public void actionPerformed{comboBox.validate; ... If you have to update the GUI with the results of your time consuming task you may or may not have to wrap that code in EventQueue.invokeLaterto get it to execute on the EDT. ...
    (comp.lang.java.gui)
  • Re: (newbie) How to get the UI to update right away
    ... When you make a selection from the combo box, ... listener fires off and does a bunch of stuff that takes a few seconds ... public void actionPerformed{comboBox.validate; ... If you have to update the GUI with the results of your time consuming task you may or may not have to wrap that code in EventQueue.invokeLaterto get it to execute on the EDT. ...
    (comp.lang.java.gui)
  • Re: (newbie) How to get the UI to update right away
    ... When you make a selection from the combo box, ... listener fires off and does a bunch of stuff that takes a few seconds ... public void actionPerformed{comboBox.validate; ... If you have to update the GUI with the results of your time consuming task you may or may not have to wrap that code in EventQueue.invokeLaterto get it to execute on the EDT. ...
    (comp.lang.java.gui)