java applet 程序怎么运行?
编译成功,新建了一个hello.html输入appletviewerhello.html出现一个窗口,里面显示"已启动小应用程序"可是没有我的"hello"这是我的代码i...
编译成功,新建了一个hello.html
输入 appletviewer hello.html
出现一个窗口,里面显示 "已启动小应用程序"
可是没有我的 "hello"
这是我的代码
import java.awt.Graphics;
import java.applet.Applet;
public class hello extends Applet{
public String s;
public void init(){
s=new String("hello");
}
public void point(Graphics g){
g.drawString(s,25,25);
}
} 展开
输入 appletviewer hello.html
出现一个窗口,里面显示 "已启动小应用程序"
可是没有我的 "hello"
这是我的代码
import java.awt.Graphics;
import java.applet.Applet;
public class hello extends Applet{
public String s;
public void init(){
s=new String("hello");
}
public void point(Graphics g){
g.drawString(s,25,25);
}
} 展开
2个回答
展开全部
hello.html是怎么写的?类路径是否正确?
下面是JDK中自带的applet的例子(jdk安装路径\demo\applets\Animator\example1.html)
<applet code=Animator.class width=460 height=160>
<param name=imagesource value="images/Beans">
<param name=backgroundcolor value="0xc0c0c0">
<param name=endimage value=10>
<param name=soundsource value="audio">
<param name=soundtrack value=spacemusic.au>
<param name=sounds value="1.au|2.au|3.au|4.au|5.au|6.au|7.au|8.au|9.au|0.au">
<param name=pause value=200>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
</applet>
下面是JDK中自带的applet的例子(jdk安装路径\demo\applets\Animator\example1.html)
<applet code=Animator.class width=460 height=160>
<param name=imagesource value="images/Beans">
<param name=backgroundcolor value="0xc0c0c0">
<param name=endimage value=10>
<param name=soundsource value="audio">
<param name=soundtrack value=spacemusic.au>
<param name=sounds value="1.au|2.au|3.au|4.au|5.au|6.au|7.au|8.au|9.au|0.au">
<param name=pause value=200>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
</applet>
2014-03-15
展开全部
贴上你的hello.html代码
更多追问追答
追问
追答
请把hello.class和hello.html放置在同一目录下
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询