标题:applet问题
取消只看楼主
叶兵
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2006-4-14
 问题点数:0 回复次数:1 
applet问题

//<applet code=FirstApplet width=100 height=100>
//</applet>
package com.davidflanagan.examples.applet;
import java.applet.*; // Don't forget this import statement!
import java.awt.*; // Or this one for the graphics!

/** This applet just says "Hello World! */
public class FirstApplet extends Applet {
// This method displays the applet.
public void paint(Graphics g) {
g.drawString("Hello World", 25, 50);
}
}

输出如下:
E:\java>appletviewer FirstApplet.java
载入:找不到类 FirstApplet。
java.lang.ClassNotFoundException: FirstApplet
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:168)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:599)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:712)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:641)
at sun.applet.AppletPanel.run(AppletPanel.java:320)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: E:\java\FirstApplet.class (系统找不到
指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:161)
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:280)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:158)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
... 8 more
谁能告诉我是为什么吗?

搜索更多相关主题的帖子: applet 
2007-10-23 23:53
叶兵
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2006-4-14
得分:0 
package com.davidflanagan.examples.applet;
被我去了
是不是我的路径设的有问题啊
我的classpath
C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_04\lib\rt.jar

I believe i can
2007-10-24 00:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-180258-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.041978 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved