downloading class files

Reply

Join Date: Nov 2005
Posts: 10
Reputation: topito2 is an unknown quantity at this point 
Solved Threads: 0
topito2 topito2 is offline Offline
Newbie Poster

downloading class files

 
0
  #1
Nov 25th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: downloading class files

 
0
  #2
Nov 25th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 10
Reputation: topito2 is an unknown quantity at this point 
Solved Threads: 0
topito2 topito2 is offline Offline
Newbie Poster

Re: downloading class files

 
0
  #3
Nov 25th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: downloading class files

 
0
  #4
Nov 26th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 10
Reputation: topito2 is an unknown quantity at this point 
Solved Threads: 0
topito2 topito2 is offline Offline
Newbie Poster

Re: downloading class files

 
0
  #5
Nov 26th, 2005
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)

---------------------------------------------------------------
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: downloading class files

 
0
  #6
Nov 26th, 2005
Just what I thought, there's another class.

The class is called:

MagNCanv.class
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 10
Reputation: topito2 is an unknown quantity at this point 
Solved Threads: 0
topito2 topito2 is offline Offline
Newbie Poster

Re: downloading class files

 
0
  #7
Nov 26th, 2005
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC