ItemStateListener接口
此接口在那些想具有处理同意form中相关组件之间的内部状态变化能力的方法中实现,接口必须实现
void itemStateChanged(Item item) 方法,当指定Item发生如下几种变化的情况:
changes the set of selected values in a ChoiceGroup; //choiceGroup的值发生变化
adjusts the value of an interactive Gauge; //调节相互度量的值(相对的值???)
enters or modifies the value in a TextField; //输入或者更改了文本框中的值
enters a new date or time in a DateField; and //输入新的数据或者事件在数据域
回车算不算呢???
txt.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){ if(e.getSource() == tex)){ Write method of want you want in this area; } }});
addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){ if(e.getSource() == tex)){ Write method of want you want in this area; } }});