Stats

63 Contributors: 4 Thursday, February 9, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Applets

Introduction

Applets have been part of Java since its official release and have been used to teach Java and programming for a number of years.

Recent years have seen an active push to move away from Applets and other browser plugins, with some browsers blocking them or actively not supporting them.

In 2016, Oracle announced their plans to deprecate the plugin, Moving to a Plugin-Free Web

Newer and better APIs are now available

Remarks

An applet is a Java application that normally runs inside a web browser. The basic idea is to interact with the user without the need to interact with the server and transfer information. This concept was very successful around the year 2000 when internet communication was slow and expensive.

An applet offers five methods to control their life cycle.

method namedescription
init()is called once when the applet is loaded
destroy()is called once when the applet gets removed from memory
start()is called whenever the applet gets visible
stop()is called whenever the applet get overlapped by other windows
paint()is called when needed or manually triggered by calling repaint()

Related Examples