Core Java Tutorial

Define Java

C vs C++ vs Java

Java Virtual Machine

Java First Program

Java Data Types

Java Tokens

Java Keywords

Java Operators

Operator Precedence

Java Type Casting

Java Statement

Java If statement

Java Switch statement

Java Loops

Java Jumping Statement

Java Arrays 1D

Java Arrays 2D

Java Variable Size Array

Java Vector

Java Math Methods

Java String Methods

Java String Buffer

User-Defined Method

Java Method Overloading

Java Class & Object

Java Constructor

Java Inheritance

Java Interface

Java Packages

Java Multi-threading

Exceptional Handling

File Handling

Java Applets

Java DataBase Connectivity

Page Stats

Visitor: 214

Java Applets

Applets are small java programs developed for internet applications. An applet located on a distant computer (Server) can be downloaded via Internet and executed on a local computer (client) using a java capable browser. They can be run using “appletviewer” command on any web browser that supports java. Like, any application program applet can perform arithmetic operations, display graphics, play sounds, accept user input, create animation and play interactive games. Java applets make a significant impact on World Wide Web.

Limitation of applet over application program

  1. Applet do not use main () method for initiating the execution of the code.
  2. Applet cannot be run independently. They run using HTML tags.
  3. Applet cannot read or write to the files.
  4. Applets cannot communicate with other server on the network.
  5. Applets cannot run any program from the local computer.

Disadvantages of using Applets:

  1. Unlike stand alone application, applet cannot run independently. They are run from inside a web page using a special feature known as HTML tag.
  2. Applet cannot read from or write to the file in the local computer.
  3. Applet cannot communicate with the other server.
  4. Applet cannot run any program from local computer.
  5. Applets are restricted from using library from the other languages such as C or C++.

Use of Applets:

  1. When we want to display web page dynamic.
  2. When we require some flash outputs like produce sounds, animations or other effects.
  3. When we want to create a program on the internet.

Applet Life Cycle:

  1. Born or Initialization state (init).
  2. Running state (paint).
  3. Idle state
  4. Dead or destroyed state.