Java Glossary : JApplet

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : J words : JApplet.

JApplet
Allows java programs to run in browsers. It is the swing version of Applet and it behaves the same.

Switch Hitter

By adding the following method to your Applet, you can allow it be run either as an Applet or as an application. If your Applet were called MyApplet, here is the code to add to the MyApplet class to make it also into an application:
view
Your Applet can get hold of the parameters in the HTML.
That code is quite crude. It will not do such things as: The easiest way to deal with these problems is to use two JApplet constructors, one the usual default constructor and one that passes the param information in. Inside you can keep track of which mode you are running in with a boolean you set in the constructor. getParameter( "favouriteColour" ) will return the String "orange" . When you write an Applet often you will override some of the following methods: init() , start() , stop() , destroy() and paint(Graphics g) . There is equivalent code for Applet.


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 2718.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/japplet.html J:\mindprod\jgloss\japplet.html