Applets are applications intended to be embedded in HTML or otherwise transported across a networkThe java.awt package provides an easy-to-use set of standard graphical user interface (GUI) elements.
The Java Application Programming Interface, Volume 2
James Gosling and FrankYellen
First some words about the applet generic framework .
The purpose of these examples is to provide a catalog of possible interactions that can be used in applet development. There is a bit of putting the cart before the horse in some of this but somebody has to go first!
1.The first applet applet is presented to demonstrate the fact that applets are truly part of the WebPage in which they are embedded. In particular, they respond to browser events. The applet is completely browser-event-driven.
2.The next applet adds a button to drive the action. Of course it still depends on the browser to pass mouse clicks. Moreover, other browser events are still passed. Finally, the "EVENT MODEL" used in this applet was the only one that was available in Java 1.0. Java 1.1 also provides a more powerful Model that will be discussed in a later section. Continued support for the Event Model presented in this applet seems to be an issue to be decided.
3.Next is an example of inter-applet communication throught the browser, within a WebPage.
4.The next example uses the Java Console to show interactions. This allows us to use the Java Console as an important applet debugging tool. This example also introduces the notion of a "Thread". Again, much more will be said about this in later sections.
5.The final example shows how to communicate between Java and JavaScript. There are some issues here involving BrowserWars( will it or will it not run in Internet Explorer?). Compiling the Java code is also an issue because you need to "find" netscape.javascript.