| |
| Java applications are standalone Java programs that can
be run by using just the Java interpreter, for example, from a command line. |
| |
| Java applets are run from inside a World Wide Web browser. |
| |
| A reference to an applet is embedded in a Web page
using a special HTML tag. When a reader, using a Java-enabled
browser, loads a Web page with an applet in it, the browser
downloads that applet from a Web server and executes it on
the local system (the one the browser is running on). |
| |
| (The Java interpreter is built into the browser and runs the
compiled Java class file from there.) |
| |
| Because Java applets run inside a Java browser, they
have access to the structure the browser provides: an existing
window, an event-handling and graphics context, and the surrounding user interface. |
| |
| A single Java program can be written to operate as
both a Java application and a Java applet. While we use
different procedures and rules to create applets and
applications, none of those procedures or rules conflict with each other. |
| |
| The features specific to applets are ignored when the
program runs as an application, and vice versa. |
| |
| |