Topic: 帮忙看一下错在哪里了阿? 谢谢! |
Print this page |
1.帮忙看一下错在哪里了阿? 谢谢! | Copy to clipboard |
Posted by: gdcfjy Posted on: 2006-10-06 13:21 import java.awt.*; import java.awt.event.*; class liao{ Frame fr; Button bt1; Panel pnl1; Panel pnl2; TextField txt; TextArea txtget; public void init() { fr=new Frame(); bt1=new Button("ok"); pnl1=new Panel(); pnl2=new Panel(); txt=new TextField(); txtget=new TextArea(); fr.add(pnl1); pnl1.add(bt1); pnl1.add(txt); txt.addActionListener(this); fr.add(pnl2); pnl2.add(txtget); } public void event() { public void actionPerformed(ActionEvent bt1) { txtget.setText(txt.getText() ); } fr.addWindowListener(new WindowAdapter()) { public void Closing(WindowEvent e) { System.exit(0); } } } public static void main(String[] arg) { fr.init(); fr.event(); } } |
2.Re:帮忙看一下错在哪里了阿? 谢谢! [Re: gdcfjy] | Copy to clipboard |
Posted by: zqailc Posted on: 2006-11-10 21:17 既然有事件,怎么没有注册监听器呢?implements ActionListener |
3.Re:帮忙看一下错在哪里了阿? 谢谢! [Re: gdcfjy] | Copy to clipboard |
Posted by: lisliefor Posted on: 2006-11-11 21:08 txt.addActionListener(this); 有问题,你的类liao并没有实现ActionListener接口! lz写的event()方法,不知道出于何种目的。 |
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 |