| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 899 人关注过本帖
标题:为什么关闭按钮不起作用?
取消只看楼主 加入收藏
zzxwill
Rank: 1
等 级:新手上路
帖 子:398
专家分:0
注 册:2007-8-15
收藏
 问题点数:0 回复次数:0 
为什么关闭按钮不起作用?

package applet;
import java.awt.*;
import java.awt.event.*;
//我添加了事件处理程序,但为什么关闭按钮还是不起作用?谢谢
public class MyTextArea extends Frame implements TextListener {
static Frame fr=new Frame("My new window!Superb!");
TextArea ta1,ta2;
public MyTextArea(){
setBounds(0,0,200,160);
String str1="Come on,boy!";
String str2="What a sunny day today!";
ta1=new TextArea(str1,10,6,TextArea.SCROLLBARS_VERTICAL_ONLY);
ta2=new TextArea(str2,10,6,TextArea.SCROLLBARS_HORIZONTAL_ONLY);
setLayout(new FlowLayout(FlowLayout.LEFT));
ta1.addTextListener(this);
ta2.setEditable(false);
add(ta1);
add(ta2);
setVisible(true);
}

public void textValueChanged(TextEvent e){
ta2.setText(ta1.getText());
}
public static void main(String args[]){
new MyTextArea();

fr.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
);

}

}

搜索更多相关主题的帖子: ONLY 按钮 Frame awt 
2007-11-18 15:13
快速回复:为什么关闭按钮不起作用?
数据加载中...
 
   



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

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