Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3728

(newbie) How to get the U

From "mrstephengross" <mrstephengross@THRWHITE.remove-dii-this>
Subject (newbie) How to get the U
Message-ID <7f9ba402-e19a-4975-9d35-4b4b6fb4f19a@p25g2000hsf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:46 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar | Unroll thread


Thread

(newbie) How to get the U "mrstephengross" <mrstephengross@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web