Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #3096 > unrolled thread
| Started by | "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:42 +0000 |
| Last post | 2011-04-27 15:42 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.gui
Re: Two JComboBoxes One c "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:42 +0000
| From | "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:42 +0000 |
| Subject | Re: Two JComboBoxes One c |
| Message-ID | <fnpip6$qcn$1@aioe.org> |
To: comp.lang.java.gui,comp.l On 30.01.2008 10:46, Roedy Green allegedly wrote: > On Mon, 28 Jan 2008 12:59:25 -0500, RC <raymond.chui@nospam.noaa.gov> > wrote, quoted or indirectly quoted someone who said : > >> Vice versa, if combo2 itemStateChanged, then combo1 also >> itemStateChanged. >> >> Any idea how to do that? > > Use a listener that sets the state of the other. the problem is you > get fibrillation, where each change triggers another, ad-infinitum. > > So you must set a boolean somewhere to say, "ignore trigger" > > When you get a trigger you check the boolean. If it says ignore, you > set it false and do nothing. If it is false you set it true and > trigger the other widget. Depends on whether the relationship between his two models is bijective, though, that is whether any item of any of the two models is mapped to exactly one of the other model. If it is, it should work alright, since calling setSelectedItem with the currently selected item (may be null) doesn't fire any ItemEvent (though it does fire an ActionEvent). Follow-up to c.l.j.g --- * 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 top | Article view | comp.lang.java.gui
csiph-web