Closed Thread Icon

Preserved Topic: Creating an applet (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21139" title="Pages that link to Preserved Topic: Creating an applet (Page 1 of 1)" rel="nofollow" >Preserved Topic: Creating an applet <span class="small">(Page 1 of 1)</span>\

 
sharma
Bipolar (III) Inmate

From:
Insane since: Dec 2000

posted posted 04-11-2003 06:19

I started a similar topic here, but I think this might be a better place for help as I think my problem lies more in java than in html.

Anyway, I have written a java program that utilizes swing. It consists of 9 classes and some images. As it is now, it runs inside a JFrame. From what I've gathered from reading various articles, I need to change things so that the program runs inside of a JApplet. And I must use the init() method of the JApplet to start that applet running. I then need to create a jar file that contains all of the necessary files, plus contains a manifest file that specifies the location of the main method. Then the html specifies the jar file to run.

My first problem is that i'm not 100% clear on the init() method. Do i still need a main method? I would think so.

Second, I have tried to create my jar file using this syntax: jar cvfm nok.jar manifest.mf *.class *.jpg *.gif . When i try to run this jar file be using java -jar nok.jar I get a message saying: Exception in thread "main" java.lang.NoClassDefFoundError: NokPackage/Main . Not sure what I'm doing wrong there.

I'm probably missing something in this process. So any help would be appreciated. Thanks in advance.

[edit] Also, when making my jar file, do all of my classes have to be contained in a package?

[This message has been edited by sharma (edited 04-11-2003).]

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-11-2003 11:19

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-11-2003 12:23

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

sharma
Bipolar (III) Inmate

From:
Insane since: Dec 2000

posted posted 04-12-2003 00:06

hey ini, thanks man. That all makes sense and helps me alot. I've managed to get a jar file working when I use the version of the code that uses a JFrame. I'm still having trouble with the JApplet though. I guess this is what i'm not understanding. The JApplet runs itself through it's init() method. But what calls that method? I need to create an instance of a JApplet somewhere. Is that what I should be doing in my main method? And also, my manifest file has to specify which class in the jar contains the main method. So that leads me to believe that I DO need a main method somewhere. Still feeling confused, but I'm making progress. Once I get this much squared away I still have to try to figure out the necessary html. But that can wait for now. Thanks for the replies so far. They've been really helpful.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-12-2003 09:07

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu