Topic: 大家帮忙看看我这个JComboBox的itemStateChanged事件怎么被执行了2次 |
Print this page |
1.大家帮忙看看我这个JComboBox的itemStateChanged事件怎么被执行了2次 | Copy to clipboard |
Posted by: blueman Posted on: 2004-09-27 18:04 package wzs; import javax.swing.*; import java.awt.event.*; public class testComboBox extends JComboBox implements ItemListener{ public testComboBox() { super(); this.addItem("first"); this.addItem("second"); this.addItemListener(this); } public void itemStateChanged(ItemEvent event) { if(event.getStateChange() == ItemEvent.SELECTED) { System.out.println(event.getStateChange()); } else { System.out.println(event.getStateChange()); } } } |
2.Re:大家帮忙看看我这个JComboBox的itemStateChanged事件怎么被执行了2次 [Re: blueman] | Copy to clipboard |
Posted by: diystar Posted on: 2004-09-29 16:58 一共发生了2个事件,旧的选项DESELECTED,以及新的选项SELECTED |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |