照着书enter the code ,there is also some wrong with it,please help me 是Event.WINDOW_DESTROY 不是 Event.WINDOW_DESTORY另外你看的书也太老了,这种java1.0的事件处理方式,数年前就淘汰了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ApplctFrame 为内部类 修改为:import java.awt.*;public class Hello{public static void main(String args[]){ApplctFrame MyFrame=new ApplctFrame();}//} 删除一}class ApplctFrame extends Frame{ Label prompt; TextField input; Label output; ApplctFrame() { super("Application Graphics Frame"); setLayout(new FlowLayout()); prompt=new Label("enter a character please"); input=new TextField(9); output=new Label(" "); add(prompt); add(input); add(output); pack(); show(); } public boolean action(Event e,Object o) { output.setText("you've entered character"+o.toString()); return true; } public boolean handleEvent(Event evt) { if (evt.id == Event.WINDOW_DESTORY) System.exit(0); return super.handleEvent(evt); }}}//添加一} 刚刚看了一个师兄的招聘题目,二叉树鸭梨啊,求参考 Java 制作类似windows 点击文件缩略图 修改文件名 急!一个急于解决的读写问题。大家快来帮帮菜鸟吧! 大家看了 请大家帮忙看一个关于异常的问题 我想用webwork但是不想用spring作电子商务网站的用什么架构亚 如何在jtextpane中设置 使得 显示rtf格式的文档内容 请问谁下这本正则表达式的电子书,国内好像买不到! java初学者的几个问题。 请大家帮帮忙吧 java文件无法在NT或WIN2000下解译,请帮助! 用89个线程分别对一个网址进行10000次连接的问题
修改为:
import java.awt.*;
public class Hello
{
public static void main(String args[])
{
ApplctFrame MyFrame=new ApplctFrame();
}
//} 删除一}class ApplctFrame extends Frame
{
Label prompt;
TextField input;
Label output;
ApplctFrame()
{
super("Application Graphics Frame");
setLayout(new FlowLayout());
prompt=new Label("enter a character please");
input=new TextField(9);
output=new Label(" ");
add(prompt);
add(input);
add(output);
pack();
show();
}
public boolean action(Event e,Object o)
{
output.setText("you've entered character"+o.toString());
return true;
}
public boolean handleEvent(Event evt)
{
if (evt.id == Event.WINDOW_DESTORY)
System.exit(0);
return super.handleEvent(evt);
}
}
}//添加一}