Topic: 请教如何在Jcreator中运行Applet

  Print this page

1.请教如何在Jcreator中运行Applet Copy to clipboard
Posted by: spanxzw
Posted on: 2003-02-28 10:50

设置应该没没问题,因为Application编译运行可以通过,但Applet只能编译,运行时提示“Exception in thread 'main' java.lang.NoSuchMethod Error:main”
在哪里高手对Jcreator比较熟悉,望不吝赐教,谢谢!

2.Re:请教如何在Jcreator中运行Applet [Re: spanxzw] Copy to clipboard
Posted by: scottding
Posted on: 2003-02-28 12:38

你要编写一个html文件,然后运行这个文件就可以了。

3.Re:请教如何在Jcreator中运行Applet [Re: spanxzw] Copy to clipboard
Posted by: samx
Posted on: 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.
}

4.Re:请教如何在Jcreator中运行Applet [Re: spanxzw] Copy to clipboard
Posted by: itfirst
Posted on: 2003-02-28 19:31

设置的问题

5.Re:请教如何在Jcreator中运行Applet [Re: spanxzw] Copy to clipboard
Posted by: spanxzw
Posted on: 2003-03-01 11:18

多谢各位,小弟茅塞顿开!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923