Types of Applets in Java
A special type of Java program that runs in a Web browser is referred to as Applet. It has less response time because it works on the client-side. It is much secured executed by the browser under any of the platforms such as Windows, Linux and Mac OS etc. There are two types of applets that a web page can contain.
Let's understand both types of Applet one by one:
Local Applet is written on our own, and then we will embed it into web pages. Local Applet is developed locally and stored in the local system. A web page doesn't need the get the information from the internet when it finds the local Applet in the system. It is specified or defined by the file name or pathname. There are two attributes used in defining an applet, i.e., the codebase that specifies the path name and code that defined the name of the file that contains Applet's code.
Specifying Local applet
Let's take an example of Local applet to understand how we can create it and embedded it into web page.
Execute the above code by using the following commands:
A remote applet is designed and developed by another developer. It is located or available on a remote computer that is connected to the internet. In order to run the applet stored in the remote computer, our system is connected to the internet then we can download run it. In order to locate and load a remote applet, we must know the applet's address on the web that is referred to as Uniform Recourse Locator(URL).
Specifying Remote applet
Difference Between Local Applet and Remote Applet
The following table describes the key differences between Local applet and Remote applet.