我需要此applet位于herelink text(在弹出窗口中也是如此:hxxp://tcip.mste.illinois.edu/applet_popup.php?num = 2)
(访问上面的链接时,请将“ hxxp”替换为“ http”)
我已经下载(实际上是整个站点的镜像:D)所有的罐子和js文件.
其中一个js(tcip.js)描述了哪个小程序将被称为&从哪个类位于特定的jar文件中.
那么,我如何离线执行/运行它?难道我必须将所有jar文件都包含在netbeans项目中?然后运行吗?
我是Java& amp;的初学者在我的大学中,我非常需要这个applet来进行电网演示
如果有人可以帮助我,我将非常感谢.
我能够在页面源代码中获得的一行内容是:
edu.uiuc.TCIP.education.summer06.lessons.lesson4.Lesson4Applet
这是什么意思..?就像我下载的所有5-6个jar文件都同时运行..然后,一个名为“ lessons”或“ lessons_old_naming”的jar文件具有此结构
edu.uiuc.TCIP.education.summer06.lessons.lesson4.Lesson4Applet
像这样的包装结构..?和Lesson4Applet是我要执行的..?
我如何获得它以供离线查看/执行..?
将不胜感激..如果您的任何人都可以为我工作..以供离线(本地执行的jar)查看.
控制台输出/错误详细信息:
Java Plug-in 1.6.0_22
Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
User home directory = C:\Users\~Ultimate~
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
解决方法:
深入研究启动该小程序的JS,表明相关的小程序元素为:
<APPLET name='myApplet' WIDTH = 800 HEIGHT = 600
CODE='edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet'
ARCHIVE='jfreechart-1.0.10.jar , jcommon-1.0.13.jar , jama-1.0.2.jar, lessons_old_naming.jar , psdataobjects.jar, psdisplayobjects.jar, anl_lpsolver.jar , zebLP.jar'>
</APPLET>
如果使用该applet元素和http://tcip.mste.illinois.edu/的代码库创建HTML,则它将正常工作.请注意,一旦将小程序加载到我的FF中,我只会得到一个“黑屏”(耸耸肩).
顺便说一句-您是否已获得Applet制造商和网站的许可使用其Applet?
顺便说一句-我已经测试了这个applet元素,并看到它在本地工作!
稍后:现在,我更加仔细地研究您的问题,我意识到我从来没有真正正确地回答过这个问题,因为我错过了“脱机”的细节.我的错!
通过添加codebase属性,我通过允许JRE返回所有资源的原始站点来“作弊”.在AFAIU中,这些资源是:
>存档属性中提到的Jar.
>小程序使用的图像.
这将更加棘手.
让我们假设您希望HTML被命名为OFFLINE_applet.html,并且希望所有内容都位于powergrid目录中.在这种情况下,结构将是..
>电网
> OFFLINE_applet.html
> jfreechart-1.0.10.jar
> jcommon-1.0.13.jar
> jama-1.0.2.jar
> lessons_old_naming.jar
> psdataobjects.jar
> psdisplayobjects.jar
> anl_lpsolver.jar
> zebLP.jar
> applet_images
>在http://tcip.mste.illinois.edu/applet_images/中找到的图像
实际上,并不需要applet_images中的每个图像.此小程序仅使用其中的20个,但是下载了所有小程序后应该可以使用.
当然,删除’codebase’属性,否则JRE仍将尝试返回http://tcip.mste.illinois.edu/站点以获得资源!
测试一下,然后回到我身边.