标题:一段很简单的代码
只看楼主
sunbiao1983
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-6-12
 问题点数:0 回复次数:1 
一段很简单的代码
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class zuoye101 extends Applet implements ActionListener
{
TextField text;
Button button;
public void init()
{
text=new TextField();
button=new Button("按钮");
add(text);
add(button);
button.addActionListener(this);
text.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{ String s=button.getLabel();
if(e.getSource()==button)
为什么这段代码有浏览器运行时,一打开浏览器就自动关闭了呢?
{
text.setText(s);
}
else if(e.getSource()==text)
{text.setText(s);
}
}
}
搜索更多相关主题的帖子: 代码 
2006-06-22 23:59
水影月圆
Rank: 4
等 级:贵宾
威 望:11
帖 子:738
专家分:0
注 册:2005-8-2
得分:0 
我这好好的嘛 没的什么怪现象出来

子非鱼,安知鱼之江湖?子非我,安知我之功夫 http://20681.
2006-06-23 00:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-74200-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.961588 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved