(newbie) How to get the UI to update right away
- From: mrstephengross <mrstevegross@xxxxxxxxx>
- Date: Fri, 27 Jun 2008 07:30:38 -0700 (PDT)
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:
public void actionPerformed(ActionEvent e)
{ comboBox.setPopupVisible(false); /* do other stuff */; }
public void actionPerformed(ActionEvent e) { comboBox.validate(); /
* do other stuff */; }
public void actionPerformed(ActionEvent e)
{ applicationFrame.validate(); /* do other stuff */; }
But nothing seems to work. I've even tried the:
SwingUtilities.invokeLater(new Runnable() { comboBox.validate(); /
*...*/ });
trick, to no avail. Any ideas? Or am I just misunderstanding the UI's
built-in behavior?
Thanks,
--Steve
.
- Follow-Ups:
- Re: (newbie) How to get the UI to update right away
- From: Knute Johnson
- Re: (newbie) How to get the UI to update right away
- From: Larry A Barowski
- Re: (newbie) How to get the UI to update right away
- Prev by Date: Re: Weird window close behavior
- Next by Date: KeyEventDispatcher receive a consumed event
- Previous by thread: Serial Port Communications with GUI
- Next by thread: Re: (newbie) How to get the UI to update right away
- Index(es):
Relevant Pages
|