An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser. An applet is actually a tiny Java program, dynamically downloaded across the network, just like an image, sound file, or video clip.
- Applet application is designed travel over the internet and execute on client side web browser. on java enabled web browser like Netscape Navigator, Internet Explorer etc. An applet is a Java class that extends the java.applet.Applet class.
- A main() method is not call an applet, and an applet class will not define main().
- Applets are designed to be embedded within an HTML page.
- When a user views an HTML page that contains an applet, the code for the applet is downloaded to the user's machine.
- A JVM is required to view an applet. The JVM can be either a plug-in of the Web browser or a separate runtime environment.
- The JVM on the user's machine creates an instance of the applet class and call various methods during the applet's lifetime.Swing provides a special subclass of the Applet class called javax.swing.JApplet. The JApplet class should be used for all applets that use Swing components to construct their graphical user interfaces (GUIs).
Comments are compile time non executable statement and compiler ignore these comments. In java there are three type of comment:
- Single Line Comment:
- Multi line comments:
- Document comments:
// This is single line commentsingle line comments with double forward slash
/*multi line comment start with forward slash followed by astric and end with astric followed by forward slash */
its begin /** and end */. its use by the Javadoc..