aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to turn an Applet into a Standalone? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to turn an Applet into a Standalone?" Watch "How to turn an Applet into a Standalone?" New topic
Author

How to turn an Applet into a Standalone?

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
This has to be a very basic question, but since I've never studied GUI in java, I don't know how it works.
I have an Applet, ParticleApplet, that I have copied from Concurrent Programming, by Doug Lea.
How can I make a "main" for this and run it as a standalone?

[ February 13, 2003: Message edited by: Garrett Smith ]

comp.lang.javascript FAQ: http://jibbering.com/faq/
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Originally posted by Garrett Smith:


[ February 13, 2003: Message edited by: Garrett Smith ]


Change the above to this:

Originally posted by Garrett Smith:


[ February 13, 2003: Message edited by: Garrett Smith ]


Replace the above with:

And that should be just about it, me thinks.
Steve


Steve
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Oh wait, a few more I think:
under:
ParticleFrame pf = new ParticleFrame();
add
pf.show();
You may have to set size and some other stuff at
this point as well (you could also set size in the
Constructor where you add canvas).
You may have to add:
pf.repaint();
in the for loop if the particles don't get drawn
Steve
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Okay, I got it to work, sort of.
I have some other problems with it, but that may be from copying the example wrong. Anyway, my code so far for this class is:

I'll probably post on the threads forum for the other stuff. This seems to be "the book" for learning threads.
Anyway, thanks for the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to turn an Applet into a Standalone?