Key Takeaways
- Java Applets, despite being considered obsolete by some, are still used in a variety of contexts and are part of course curriculums in colleges.
- Java Web Start is a framework that allows Java software to run on the internet using a web browser, overcoming many compatibility issues with browsers and Java plug-ins.
- There are two forms of Java Applets, Abstract Window Toolkit (AWT) and Swings, with Swings being considered the better option due to its flexibility and platform-independent nature.
- Oracle continues to provide updates for Java Applets, focusing on improving their usage and addressing security concerns.
- Despite some security flaws, Java Applets are still considered a viable option for embedding small Java programs in a web page, and Oracle is expected to continue improving and updating the technology.
Real World Applications of Java
- Amadeus, the largest travel company in the world uses Java for its front end GUI.
- GWT (Google Web Toolkit) is a development toolkit written in Java.
- Android devices runs Java apps on Java Virtual Machine
- Dalvik is an integral part of Android.
- Twitter Search uses a Java server called Blender(https://blog.twitter.com/2011/twitter-search-now-3x-faster)
- High quality tools are there in Java; Maven, Swing Explorer , Archiva, JMockit etc.
- GDA is a framework used for creating customized data acquisition software for scientific purposes.
- In large projects, Java is preferred. Examples include:
- Complex web applications like http://www.tdameritrade.com
- Online banking like Kotak Mahindra http://www.kotak.com
- Online Shopping Website http://www.ebay.com/
- Google Plus is written in Java and JavaScript: https://plus.google.com/
- Java ME(Micro Edition) provides a flexible environment and user interface for mobile devices, sensors, printers etc.
- Oracle SQL Developer is written in Java.
- A rapid web application development platform ColdFusion is written in Java.
- A software system lifecycle management (SSLM) and application lifecycle management (ALM) platform known as “Integrity” is written in Java.
- Google Guice is an open source software framework is written in Java
Real World Applications of Java Applets
- ThinkFree: Professional Online Office Suit based on Java Applets and Ajax.
- JPC Emulator: It is an x86 emulator written in Java and uses Java Applets.
- Statistics: Usage of Applets in developing Web Applications in Statistics is not yet obsolete.
- Education: Still studied in universities as part of course-curriculum.
- Yahoo Games: Uses Java Applets for games.
- Small Applications: Good platform to develop Small Applications
- Client Machine: When client machine is to be used the Applets can be considered a good choice i.e. in creating authentication app etc
- Android: Billions of Android devices is running them on Java Virtual Machine
- Java Web Start: It is a framework developed to run applications outside browser, explained below.
Java Web Start
It is also known as javaws or JAWS. It was developed to run as an independent application. It allows working of Java Software on Internet using Web Browser. The software does not run inside browser like Applets.Java Web Start advantages over Applets
Java Web Start overcomes many compatibility problems with browsers, java plug-ins and different JVM versions. Web Start programs are independent applications that run in separate frame. They can also launch unmodified applets packaged inside .jar files.Elimination of “restricted access” by Signed Web Start applications
Java Web Start applications run in restricted environment which doesn’t allow them to access system resources such as local files, network etc. Publishers can easily remove these restrictions by signing their Web Start applications with a tool named as jarsigner that comes with Java Development Kit.Real World Usage:
Applications | Description/Usage |
CrossFTP | FTP client and server. |
Jake2 | Java port of Quake 2. |
PowerTeacher | Gradebook program for student scores, used by schools |
Wurm Online | 3D Massively Multiplayer Online Fantasy Simulator. |
Buho21 | Game developed using Java Webstart technology. |
Autoplot | Plotting tool for various file formats like ASCII, CDF and NetCDF |
Running Reality | Historical atlas and model of human history which includes national borders, armies, and people. |
Genevestigator | Online Platform for researchers to explore data for research and clinical applications. |
Enabling Web Start (in continuation with previous project)
Follow these steps to enable Web Start as a reasonable way to run software outside browser, unlike Applets: Right-Click-> AmitJavaApplication -> Properties, then go to Web Start under Application:- launch.jnlp – JNLP is Java Network Launching Protocol. This is an XML file with elements and attributes that instruct browsers how to run the application. Some attributes of JNLP files are JNLP spec version, application title, vendor name etc.
- launch.html – This is an automatically generated HTML page that has a link to the JNLP file. Users click this link to start applications via Java Web Start.
- AmitJavaApplication.jar: The Project jar file.
Two forms of Java Applets
- Abstract Window Toolkit (AWT): AWT classes and components are contained in the java.awt package hierarchy. It is a set of APIs that provides GUI for java program like buttons, checkbox etc. AWTs are considered obsolete. Swings are preferred over AWT components.
- Swings: The Swing classes and components are contained in the javax.swing package hierarchy. Swing components are known as lightweight because they do not require allocation of native resources in the operating system’s windowing toolkit, whereas AWT components are referred to as heavyweight components.
As per Java 6 Update 12, it is possible to mix Swing and AWT widgets without having z-order problems (z-order is the ordering of overlapping two-dimensional objects). Before Java 6 Update 12, mixing Swing components and basic AWT widgets resulted in undesired side.
Swings are considered better than AWT:
- Swing components are not implemented by platform-specific code, they are written entirely in Java and therefore are platform-independent unlike AWT components,
- It has more flexible components than AWT.
- In J2SE 1.2, Swings superseded AWT’s widgets as it provides a richer set of UI widgets.
- Swing draws its own widgets
- Not yet obsolete, the same used by me in previous article.
Oracle Java Updates
This section provides some important information related to Java Updates and some external website sources. This consists of security enhancements, security fixes, code signing, changes in dialog boxes etc implemented by Oracle Java: Java Version History Before going further I would like you to look through Java Version History as mentioned at Wikipedia. Java SE 6 Update 10 Security fixes and Next Generation Java Plugin Next Generation Java Plug-in This release introduced a new implementation of Java Plug-in known as Next Generation Java Plug-in that provides support for applets in web browser which combines the best architectural features of applet and Java Web Start technologies. It also provides a robust platform for deployment of Java and JavaFX content in the web browser.Websites using Applets
• Mathematical AppletsConclusion
Any programming language is understood best when used perfectly in an appropriate environment and with some years of experience. Every language comes with its pros and cons. C and C++ is being used still after more than 30 years of its existence. So is Java, even after 15 years of its existence. I would like to mention that I am not a Java advocate and I don’t work for Oracle (and never worked for it before). I work as a Software Developer and Technical Writer in Java and this article reflects my research work on Java and Applets’ existence on behalf of experienced java developers around the web. With regard to Java Applets, they remain an easy way to embed small Java programs in a web page and are used in many contexts, as shown above. Applets are still part of course-curriculum in colleges. Oracle Java has been providing many updates which focuses on improving the usage of Applets. We can expect some further fixes by Oracle in terms of Applet security, signing, resources, reliability etc. It is not yet considered depreciated by Oracle; it means they’re planning something better for it in coming future (maybe in Java 8). Some security flaws were noticed in usage of Java (and Applets), but Oracle took the necessary steps to address them and updated it to avoid such flaws in future. Keep in touch here for upcoming Java Updates.Frequently Asked Questions about Java Applets
What is the main difference between Java Applets and JavaScript?
Java Applets and JavaScript are both programming languages used in web development, but they have significant differences. Java Applets are programs that are embedded in other applications, typically in a web page displayed in a web browser. They are written in the Java programming language and can run on almost any computer. On the other hand, JavaScript is a scripting language that runs on the client side, meaning it runs on your web browser without the need for a web server. It is primarily used to enhance web pages to provide for a more user-friendly experience.
Are Java Applets still used today?
Java Applets were once a popular choice for web-based applications. However, due to security concerns and the rise of other technologies such as JavaScript, their use has significantly declined. Most modern web browsers do not support Java Applets by default. Despite this, some legacy systems and educational platforms may still use Java Applets.
What are the security concerns associated with Java Applets?
Java Applets run on the client’s machine, which means they have the potential to access and interact with the user’s system. This can pose a security risk if the applet is malicious. To mitigate this risk, Java Applets run in a “sandbox” environment that restricts their capabilities. However, some security vulnerabilities have been found in the past, leading to many browsers disabling support for Java Applets.
How can I enable Java Applets in my web browser?
Most modern web browsers do not support Java Applets by default due to security reasons. However, if you need to run a Java Applet, you may need to use a legacy version of a browser or adjust your browser’s security settings. It’s important to note that enabling Java Applets can expose your system to potential security risks.
What has replaced Java Applets in modern web development?
In modern web development, technologies like JavaScript, HTML5, and CSS3 have largely replaced Java Applets. These technologies are more secure, more efficient, and are natively supported by all modern web browsers. They also allow for the creation of dynamic, interactive web content, much like Java Applets.
Can I still develop Java Applets?
Yes, it is still possible to develop Java Applets. However, given that most modern web browsers do not support them, it may be more beneficial to learn and use more current web development technologies.
What is the role of Java in the backend development?
Java is a versatile programming language widely used in backend development. It is used to build and manage the server-side of web applications, handle databases, and build dynamic web services.
What are the advantages of using Java for web development?
Java is platform-independent, meaning that applications written in Java can run on any device that has a Java Virtual Machine (JVM). It also has powerful development tools, an extensive library, and it supports multithreading, which can be beneficial for performance in web applications.
How does Java Applet work?
Java Applets are embedded in HTML pages and are loaded from the web server. When a user visits a webpage with an Applet, the Applet’s code is downloaded to the user’s machine and runs in the Java Virtual Machine (JVM).
What is the future of Java in web development?
While the use of Java Applets has declined, Java remains a popular choice for server-side web development. With the rise of frameworks like Spring Boot, Java is still widely used in building robust, scalable web applications.
Amit Diwan is a founder at Studyopedia, who has taught more than a million engineers and professionals on the following technologies: Python, Java, Android, WordPress, Drupal, Magento, JavaScript, jQuery, HTML5, Bootstrap 4, etc.