Java applet
A Java applet is a small application which is written in Java and delivered to users in the form of bytecode.
Contents
Description
A Java applet can appear in:
- A frame of the web page
- A new application window
- Sun's AppletViewer
- A stand-alone tool for testing applets
Use
The user launches the Java applet from a web page, and the applet is then executed within a Java Virtual Machine (JVM) in a process separate from the web browser itself.
History
Java applets were introduced in the first version of the Java language, which was released in 1995.
Programming languages
Java applets can be written in any programming language that compiles to Java bytecode.
They are usually written in Java, but other languages such as Jython, JRuby, Pascal, Scala, or Eiffel (via SmartEiffel) may be used as well.
Comparison with JavaScript
Java applets run at very fast speeds and, until 2011, they were many times faster than JavaScript.
Unlike JavaScript, Java applets had access to 3D hardware acceleration, making them well-suited for non-trivial, computation-intensive visualizations.
As browsers have gained support for hardware-accelerated graphics thanks to the canvas technology (or specifically WebGL in the case of 3D graphics), as well as just-in-time compiled JavaScript, the speed difference has become less noticeable.
Cross-platform
Since Java's bytecode is cross-platform (or platform independent), Java applets can be executed by browsers (or other clients) for many platforms, including Microsoft Windows, FreeBSD, Unix, OS X and Linux.
See also
- Animation
- Computer graphics
- Java (programming language)
- JavaScript
- Java Virtual Machine
- WebGL
- Web page
External links
- Java applet @ Wikipedia