急!!在监听器中得到别一个类的文本值
提示: 作者被禁止或删除 内容自动屏蔽
2010-05-18 20:50
2010-05-19 00:26
程序代码:class ActionList implements ActionListener, TextListener {
private Text text;
public ActionList(){
super();
}
public ActionList(Text text){
super();
this.text = text;
}
public void actionPerformed(ActionEvent e) {
System.out.println();
if (e.getActionCommand().equals("启动服务")) {
在这里如何来得到,下面t1中的值呢
// String tf1=((TextField) e.getSource()).getText();
//System.out.println(tf1);
if(text!=null){
String tf1=text.getTextField().getText();
System.out.println(tf1);
}
} else if (e.getActionCommand().equals("停止服务")) {
System.out.println("!!!!!!!");
} else if (e.getActionCommand().equals("t1")) {
System.out.println("!!!e!!!!");
}
}
public void textValueChanged(TextEvent e) {
// TODO Auto-generated method stub
}
}
2010-05-19 13:21
2010-05-19 14:45