找不到applet所需的类!!!!!!!!!!!!!!!!! 别用 MS 的东西了引用某虾的话M$ 的 Jvm 非正规的 Java 血统 ! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 但是决大多数机子都不会装java运行环境啊,这也是为什么我只用到java1.0 1.1的类,就是怕微软的东西不支持。谁能告诉我谁能告诉我~!!!!我在别人没装运行环境的机子上,能访问到我机子上运行有applet 的weblogic console,但是我的却不行,一定是哪里出错了。 import java.awt.*;import java.util.Vector;public class Animator extends java.applet.Applet implements Runnable{ Vector images=new Vector(); int imgNumber; int currentImage=0; Thread thisThread; public void init(/*Graphics g*/) { imgNumber=new Integer(getParameter("imgNumber")).intValue(); //g.drawString("init proc started",10,10); for(int x=0;x<imgNumber;x++) { Image img=getImage(getCodeBase(),"images/img"+(x+1)+".gif"); images.addElement(img); } //resize(100,100); } public void paint(Graphics g) { g.drawImage((Image)images.elementAt(currentImage++),0,0,null); currentImage%=imgNumber; } public void update(Graphics g) { paint(g); } public void start() { thisThread=new Thread(this); thisThread.start(); } public void stop() { thisThread.stop(); } public void run() { while(true) { repaint(); try{ thisThread.sleep(1000); } catch(Exception e){} } }} <HTML><TITLE>animator</TITLE><BODY><APPLET CODE="Animator.class"WIDTH=100 HEIGHT=100><PARAM NAME="imgNumber" VALUE=4>//</PARAM></APPLET></BODY></HTML> 跟代码没什么关系吧,用appletviewer运行的时候很正常啊,,类和网页文件放在同一个目录了。平时很少写applet,突然写个居然出这么多麻烦。 你可以试一下这样解决。用javac -target 1.1 Animator.java来编译你的类文件。因为JDK1.4编译出来的Applet可能必须用在有JRE的机器上,用 -target 1.1来指定版本编译,可以使你的Applet兼顾Microsoft VM. 我的JAVA小游戏为啥响应那么慢?(求助) 请教2个小问题 欢迎来我的空间指教 Java 里面有没有获取 本机 DNS 的类和方法? 请问:.properties能不能多行注释? 看过thinking in java并思考过的竟来看? 谁有jbuilder6.0企业正式版的注册码?紧急!!!!!!!!!!!!!! 关于java中输入输出的问题!!!!! scjp(5) 各位,能不能告诉我是否一定要去考SCJP 想做个客户端和服务端用socket通信的小程序,请问下面的代码错在哪里? 我想学习类库,大家推荐一种好的方法吧,谢谢!
import java.util.Vector;public class Animator extends java.applet.Applet implements Runnable
{
Vector images=new Vector();
int imgNumber;
int currentImage=0;
Thread thisThread;
public void init(/*Graphics g*/)
{
imgNumber=new Integer(getParameter("imgNumber")).intValue();
//g.drawString("init proc started",10,10);
for(int x=0;x<imgNumber;x++)
{
Image img=getImage(getCodeBase(),"images/img"+(x+1)+".gif");
images.addElement(img);
}
//resize(100,100);
}
public void paint(Graphics g)
{
g.drawImage((Image)images.elementAt(currentImage++),0,0,null);
currentImage%=imgNumber;
}
public void update(Graphics g)
{
paint(g);
}
public void start()
{
thisThread=new Thread(this);
thisThread.start();
}
public void stop()
{
thisThread.stop();
}
public void run()
{
while(true)
{
repaint();
try{
thisThread.sleep(1000);
}
catch(Exception e){}
}
}
}
<TITLE>animator</TITLE>
<BODY>
<APPLET CODE="Animator.class"WIDTH=100 HEIGHT=100>
<PARAM NAME="imgNumber" VALUE=4>//</PARAM>
</APPLET>
</BODY>
</HTML>
类和网页文件放在同一个目录了。
平时很少写applet,突然写个居然出这么多麻烦。
用javac -target 1.1 Animator.java来编译你的类文件。因为JDK1.4编译出来的Applet可能必须用在有JRE的机器上,用 -target 1.1来指定版本编译,可以使你的Applet兼顾Microsoft VM.