teleport pro 1.72:TestFrame.java 使用或覆盖了已过时的 API

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/04 21:58:27
package testframe;
import java.awt.*;
import java.awt.event.*;

public class TestFrame extends Frame{
public TestFrame(){
try{
Init();
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String args[]){
TestFrame testframe1 = new TestFrame();
testframe1.setSize(400,300);
testframe1.show();
}
private void Init() throws Exception{
this.setTitle("Java GUI 标准组件应用");
this.setLayout(null);
this.addWindowListener(new TestFrame_this_windowAdapter(this));
}
void this_windowClosing(WindowEvent e){
dispose();
System.exit(1);
}
}
class TestFrame_this_windowAdapter extends java.awt.event.WindowAdapter{
TestFrame adaptee;
TestFrame_this_windowAdapter(TestFrame adaptee){
this.adaptee = adaptee;
}
public void windowClosing(WindowEvent e){
adaptee.this_windowClosing(e);
}
};

jvm 提示:
TestFrame.java 使用或覆盖了已过时的 API.

我编译没问题,但是就是没办法运行.
请高手帮我解决吓.