samx
发贴: 185
积分: 52
|
于 2003-02-28 17:52
或者添加main()到你的类中: public static void main(String args[]){ Applet anInstance=new yourJAppletClass(); JFrame frame=new JFrame("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(anInstance); //Add your JApplet class into JFrame frame.setSize(300,150);//you can set any size as you want anInstance.init();//your instance initiated anInstance.start();//start your applet frame.setVisible(true);//this line should be later than calling init() and start(), or you can't see what you want. }
|