再改成: <html> <head> <title>"欢迎您"</title> </head> <body> <hr> <applet code="BoolTest.class" width=400 height=200> </applet> <hr> </body> </html>在Jcreator中运行出现如下错误: 载入:BoolTest.Class不是Public对象或没有公共构造函数。 java.lagng.IllegalAccessExceptiono:Class Sun.applet.AppletPanel can not access a member of class boolTest with modifiers ""
Applet要嵌入在网页里运行。
在run的按纽那边改成applet
然后嵌入在网页里运行
<applet code="CharDemo.class" width=800 height=600></applet>编译 CharDemo.java 后使用命令 Appletviewer CharDemo.html 执行,在 JCreator 中也可直接执行 CharDemo.html。
<head>
<title>"欢迎您"</title>
</head>
<body>
<hr>
<applet
code=BoolTest width=400 height=200>
</applet>
<hr>
</body>
</html>运行HTML,说BOOLTEST没找到,可是我放在同一目录下了,这是怎么加事呀?
<html>
<head>
<title>"欢迎您"</title>
</head>
<body>
<hr>
<applet
code="BoolTest.class" width=400 height=200>
</applet>
<hr>
</body>
</html>在Jcreator中运行出现如下错误:
载入:BoolTest.Class不是Public对象或没有公共构造函数。
java.lagng.IllegalAccessExceptiono:Class Sun.applet.AppletPanel can not access a member of class boolTest with modifiers ""
class CharDemo extends java.applet.Applet
改为public class CharDemo extends java.applet.Applet
重新编译后
再运行html.
没有错误了,但是程序启动画面后,上面什么也没有,一片空白,这又是怎么回事呀?
我就是在前台编辑状态的,运行的也是html文件