944,126 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1677
  • Java RSS
Nov 25th, 2005
0

downloading class files

Expand Post »
I have found some interesgting websites which have excellent java applets that explain physics theory. I could only view those webpages when attached to the internet, but then I learned I could download the *.class file related to the applet and then I would be able to open the webpage without being online.
The previous method has worked so far for many applets I wanted to save in my computer (to show them to my students in class), but there are some others I cannot get to work properly, even having the *.class file in the same directory where the saved webpage is. Do you have any idea of what is going on?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
topito2 is offline Offline
10 posts
since Nov 2005
Nov 25th, 2005
0

Re: downloading class files

Few possibilities:

You don't have the html to run the applet.
The applet has one or more .class files and you don't have them all.
There's security contained in the applet(for example, checking to see that it is run from the makers domain).


I would say you don't have all the class files. With the larger applets I am sure there's more than one class. Without those extra classes, you wont be able to run the applets.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Nov 25th, 2005
0

Re: downloading class files

Quote originally posted by server_crash ...
Few possibilities:

You don't have the html to run the applet.
The applet has one or more .class files and you don't have them all.
There's security contained in the applet(for example, checking to see that it is run from the makers domain).


I would say you don't have all the class files. With the larger applets I am sure there's more than one class. Without those extra classes, you wont be able to run the applets.
Thank you so much for your help.
The webpage only uses one *.class file, which is MagnusG.class, and the webpage is
http://www.rawbw.com/~xmwang/myGUI/MagnusG.html
I think the third option you give could be the cause of the problem. I used Class Editor to get the source code related to the class file, but I could not manage to disable the security, moreover it seems I can't determine what is the sentence related to the security.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
topito2 is offline Offline
10 posts
since Nov 2005
Nov 26th, 2005
0

Re: downloading class files

Hmm. After looking at it I would tend to think it's in multiple classes. Is there an error you recieve while trying to run it? Down in the task bar(bottom right), look and see if there is a coffee mug icon. If there is, right-click on it and select show console. Copy everything it shows in the console.

I think there is more than one class file, but there's really no way to tell unless you have a look at the source code. Is there any way you can post it? If it's a lot then just attach it.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Nov 26th, 2005
0

Re: downloading class files

The error I get on the bottom right of the task bar is:

exception: java.lang.NullPointerException.

There is no coffe mug icon but I opened the Java Console and got this:
-----------------------------------------------

java.lang.NoClassDefFoundError: MagNCanv
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-4" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-MagnusG.class" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NoClassDefFoundError: MagNCanv
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-11" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-MagnusG.class" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

---------------------------------------------------------------
Reputation Points: 10
Solved Threads: 0
Newbie Poster
topito2 is offline Offline
10 posts
since Nov 2005
Nov 26th, 2005
0

Re: downloading class files

Just what I thought, there's another class.

The class is called:

MagNCanv.class
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Nov 26th, 2005
0

Re: downloading class files

Thank you so much!
Now that I look at carefully the Java Console log, you are so right, the missing one was MagNCanv.class!
Dear friend, you are great!
Again, thank you!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
topito2 is offline Offline
10 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: float over-/underflow
Next Thread in Java Forum Timeline: JList - CellRendering





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC