Meaningless Drivel is fun!*
The moose likes Applets and the fly likes Can you run an applet from the command line? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can you run an applet from the command line?" Watch "Can you run an applet from the command line?" New topic
Author

Can you run an applet from the command line?

Jessica Hope
Greenhorn

Joined: Dec 04, 2008
Posts: 8
Hi, all! I'm very new here and to Java, but I've had good success so far. This seems like a good place.

Anyhow, my question is whether there is a way to run an applet from the command line or whether you have to embed the applet onto an HTML web page to run it. Obviously, the usual "java Foo" doesn't work for an applet, because it tries to call main and there may not be main in an applet (if I understand correctly).

I know that there is such a thing as "appletviewer," but I don't think I understand what that is or how it works.

To extend things a bit, I'd also appreciate a basic overview of which Java web technologies do what. I know that there are applets, servlets, JSP, Java Web Start, etc. Once one knows the lay of the land I'm sure the distinctions are obvious and clear, but when one is just starting out it's hard to know what each of these different technologies are, what they do, and in what situations one would use each.

Thanks in advance!
[ December 05, 2008: Message edited by: Jessica Hope ]
Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202
Hi

Try to go through the examples found under below link...and get familiar with applets

http://www.roseindia.net/java/example/java/applet/
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
appletviewer takes as its command-line parameter the name of an HTML file that contains an APPLET tag. In fact, the HTML file needn't contain more than just the APPLET tag, so it's easy to set up. You can find the details of the APPLET tag in the Sun Java Tutorial or in the pages mentioned by Eshwar.

Let's not talk about web technologies in this thread, as this forum is about applets; please post a new thread in the servlets forum.


Ping & DNS - my free Android networking tools app
Jessica Hope
Greenhorn

Joined: Dec 04, 2008
Posts: 8
Okay... many thanks, Eshwar and Ulf. There's lots of good information in that link, Eshwar, and I appreciate your explanation of "appletviewer," Ulf.

Cheers!
[ December 06, 2008: Message edited by: Jessica Hope ]
 
jQuery in Action, 2nd edition
 
subject: Can you run an applet from the command line?
 
Similar Threads
Question about writing a 'server'
How to call servlet from command prompt
Running applets as an application
random colour problems
problem in executing swing application