Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> HTML >> Snippet

18 Applets


..Java applets are small programs designed to run in a web browser.  Web browsers are written to provide a window,
of user-specified size, in which the applet will run.

.class
Like many languages, Java programs are written in standard text and compiled before use.  Java applets are compiled
Java programs, written with certain constraints that will allow them to execute within a browser.  The compiled Java
applet has a .class extension.

Sun Microsystems developed the Java language and offers the compiler and other Java programming tools for free.

A Java applet can require more than one .class file.  These files may be combined into a .zip or .jar compressed file
to decrease download time from the Internet.

Generally, Java applets are small in size because to run the applet it must first be downloaded from its web site.
Java applets rarely exceed a few hundred Kbytes (there's no particularly limit, other than the willingness of a site visitor
to wait for the download).

To run a Java applet a web browser makes available a portion of the browser window, in which the output of the Java
applet is displayed.

Here's the basic HTML code for inserting a Java applet  into a browser:

< applet code = myapplet.class width = 500 height = 500 >
< param name =myvar   value = 10 >
< param name =thevar value = 20 >
</ applet >

The < applet > and </ applet > tag pair bounds the applet description.  The window in which the applet is displayed
is defined by the width/height values.

Between the two tags are option < param > statements which give name/value pairs that are needed by the applet itself.

See the gbCodeLib Java tutorials for information on writing Java applets