What is Applet in Java?

This tutorial will highlight the basics process to build applets and also it discusses the advantages and disadvantages of the applets including the life cycle of an applet.

What is Applet in Java?

This tutorial will highlight the basics process to build applets and also it discusses the advantages and disadvantages of the applets including the life cycle of an applet.

What is Applet in Java?


A Java Applet is a small dynamic program which can be transferred via the Internet and run by a Java compatible web browser. It can be embedded into HTML pages, which runs on the java enables web browsers such as mozila and Internet explorer. Applet is designed to run remotely on the client browser, so there are some restrictions on it. Applet can't access system resources on the local computer. Applets are used to make the web site more dynamic and entertaining.

The main difference between Java based applications and applets is that these are typically executed in an Applet viewer or Java compatible web browser.

Life cycle of an Applet:

There are four methods in the Applet class, which provides you the framework on which one can build any significant applet. These are init, start, stop, destroy and paint.

What are the advantages of Applet?

  • Applets are cross platform and can run on Windows, Mac OS and Linux platform.
  • Automatically integrated with HTML, hence resolved virtually all installation issues.
  • Applets can work all the version of Java Plugin
  • Applets runs in a sandbox, so the user does not need to trust the code, so it can work without security approval.
  • It can be accessed from various platforms and various java-enabled web browsers.
  • Applets are cached in most web browsers, so will be quick to load when returning to a web page.
  • User can also have full access to the machine if user allows.

Disadvantages of Java Applet:

  • Applets can't with any host other than the originating server.
  • Java plug-in is required to run applet
  • Java applet requires JVM so first time it takes significant startup time
  • If applet is not already cached in the machine, it will be downloaded from Internet and will take time.
  • Applets can't read and write to local computer's file system.

For more about Java Applets topics visit the below links

Tutorials

  1. What is an Applet
  2. The Life cycle of An Applet
  3. Java Applet - Creating First Applet Example
  4. Java - Drawing Shapes Example in java
  5. Java - Drawing Shapes Example using color in java
  6. Java - Event Listeners Example in Java Applet
  7. Applet - Passing Parameter in Java Applet
  8. Opening a URL from an Applet
  9. Java - Opening a url in new window from an applet
  10. Applet is not Working
  11. Display image in the applet
  12. Applet Write Files Example
  13. Play Audio in Java Applet
  14. Security Issues with the Applet
  15. Swing Applet Example in java
  16. The Sample Banner Example in Java
  17. Clock Applet in Java
  18. HTML Document Creation
  19. Tag Parameters: The Tag
  20. The APPLET Tag in Detail
  21. Java and HTML: The Basics
  22. What Exactly is HTML?
  23. Welcome to the Internet
  24. java.applet package examples
  25. java.applet package examples
  26. What is an Applet - Java Applet Tutorial
  27. Java - Read file Applet
  28. Applet versus Application
  29. Tag Parameters: The Tag
  30. Java - Opening a url in new window from an applet
  31. Java - Opening a URL from an Applet
  32. Applet Tag Parameters,Applet Tag in HTML
  33. Applets in Java
  34. What is Applet in Java?
  35. What is Applet in Java with Example?