添加这段代码,也就是添加了main法只需要把test 这个类名 改成自己的applet的类名就好了大家可以试试呵呵
public static void main(String[] args){
test applet = new test();
JFrame frame = new JFrame("PinTu");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e){
System.exit(0);
} });
frame.getContentPane().add( applet, BorderLayout.CENTER);
frame.setSize(650,520);
applet.init();
applet.start();
frame.setVisible(true);
}
public static void main(String[] args){
test applet = new test();
JFrame frame = new JFrame("PinTu");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e){
System.exit(0);
} });
frame.getContentPane().add( applet, BorderLayout.CENTER);
frame.setSize(650,520);
applet.init();
applet.start();
frame.setVisible(true);
}