Article View: borland.public.jbuilder.java.api
Article #2197Combo Box ItemStateChange -- Seems to Fire 2X Per Change!
From: Harry Whitehouse
Date: Mon, 23 Apr 2001 07:17
Date: Mon, 23 Apr 2001 07:17
30 lines
1791 bytes
1791 bytes
I must be missing a simple, basic concept WRT JComboBoxes. I have an applet
which instantiates one combobox...
JComboBox jComboBoxMailingType = new JComboBox();
I add and item listener, and populate the combobox with a few selections.
jComboBoxMailingType.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(ItemEvent e) {
jComboBoxMailingType_itemStateChanged(e);
}
});
I've chosen to listen for itemStateChanged() which invokes a process....
void jComboBoxMailingType_itemStateChanged(ItemEvent e) {
DoSomeProcess();
}
Now the curious thing is I enter the event handler TWICE whenever I change
the combobox selection. I'd expect to enter this handler function once per
change in selection.
Baiscally, I want to DoSomeProcess() once when the combobox selection
changes to a new value. Can someone point out what I'm missing here?
TIA
Harry
Technical Details
Message-ID:
<3ae3d70e_2@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,3b1cfaee1687958,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-04-23 00:44:05 PST From: "Harry Whitehouse" <harry@envmgr.com> Newsgroups: borland.public.jbuilder.java.api Subject: Combo Box ItemStateChange -- Seems to Fire 2X Per Change! Date: Mon, 23 Apr 2001 00:17:38 -0700 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 38.168.115.135 Message-ID: <3ae3d70e_2@dnews> X-Trace: dnews 988010254 38.168.115.135 (23 Apr 2001 00:17:34 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnews