Home » Programming »
Java Applet
A Java applet is an applet delivered to users in the form of Java bytecode. Java applets can run in a Web Browser using a Java Virtual Machine (JVM), or in Sun’s AppletViewer, a stand-alone tool for testing applets. Java applets were introduced in the first version of the Java language in 1995, and are written in programming languages that compile to Java bytecode, usually in Java, but also in other languages such as Jython JRuby, or Eiffel (via SmartEiffel).
Java applets run at speeds comparable to, but generally slower than, other compiled languages such as C++, but until approximately 2011 many times faster than JavaScript. In addition they can use 3D hardware acceleration that is available from Java. This makes applets well suited for non trivial, computation intensive visualizations. When browsers have gained support for native hardware accelerated graphics in the form of Canvas_element and WebGL, as well as Just in Time compiled JavaScript, the speed difference has become less noticeable.
Java applets are programs that are embedded in other applications, typically in a Web page displayed in a Web Browser.
// Hello.java
import javax.swing.JApplet;
import java.awt.Graphics;
public class Hello extends JApplet {
@Override
public void paintComponent(Graphics g) {
g.drawString(“Hello, world!”, 65, 95);
}
}
The import statements direct the Java Compiler to include the javax.swing.JApplet and java.awt.Graphics classes in the compilation. The import statement allows these classes to be referenced in the source code using the simple class name (i.e. JApplet) instead of the fully qualified class name (i.e. javax.swing.JApplet).
Posted in
Programming
Related posts:
If you enjoyed this article, subscribe to receive more great content just like it.
Recent Stories
Recent Comments
Tag Cloud
Disclaimer
JUST LIKE IN ANY OTHER BLOGGER IN THE BLOG SPHERE, THIS BLOGGER DOES NOT CLAIM OWNERSHIP IN ANY INFORMATION HEREIN POSTED. INFOTECHGUIDE.BLOGSPOT.COM IS DESIGNED TO PROVIDE BASIC INFORMATION ABOUT INFORMATION TECHNOLOGY THAT INTEREST USUAL ONLINE READERS. IF YOU HAVE ANY CONCERN AND SUGGESTION ABOUT THIS SITE PLEASE FEEL FREE TO CONTACT US OR LEAVE A COMMENT FOR THE APPROPRIATE ADJUSTMENT
Labels
- Computer Tips and Tricks (8)
- Content Management System (1)
- Data Structures using Java (15)
- Database Management Systems (2)
- File Formats (7)
- Gadgets Reviews (2)
- Games Reviews (2)
- hardware (16)
- Internet Terms (7)
- Management Information System (5)
- networking (8)
- Programming (15)
- sofware (17)
- Tech News (4)
- Web Design (4)
0 comments for this post
Leave a reply