是Event.WINDOW_DESTROY 不是 Event.WINDOW_DESTORY
另外你看的书也太老了,这种java1.0的事件处理方式,数年前就淘汰了

解决方案 »

  1.   

    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);
        }
    }
    }//添加一}