I simply tried running a simple Java applet using extends Applet
and extends JApplet
too as suggested when I searched for it on Google. I am still getting the error:
no main class found
How can I resolve this?
Applets don't have a main method, you need to load applets by appletviewer or in a browser
for example:
<APPLET CODEBASE="../classes/" ARCHIVE="your_jar.jar"
CODE=DemoApplet.class WIDTH=140 HEIGHT=45>
<PARAM NAME="HELPURL" VALUE="help.htm">
</APPLET>
Remebemer java.awt.Applet
需要run
, paint
和destroy
方法,我很久以前在ReadyToProgram
上测试了一些Applets
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.