Java Applets: Obsolete or Still Part of the Web?

Share this article

This article is a follow-up to Embedding an Applet in a Web Application. In this article, I will list some topics related to java and Java Applets that will give strong points about their use with proper resources. Some other related content for Java Applets will also be discussed here. Java is considered as a desired skill among programmers all over the world. As Java Applet is an application of Java, so I would like to start with some information about Applications of Java in real world:

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:
  • 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
The below given statistical information is taken from: http://www.java.com/en/about/ applet2fig1
Figure 1: Real World Applications of 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:

ApplicationsDescription/Usage
CrossFTPFTP client and server.
Jake2Java port of Quake 2.
PowerTeacherGradebook program for student scores, used by schools
Wurm Online3D Massively Multiplayer Online Fantasy Simulator.
Buho21Game developed using Java Webstart technology.
AutoplotPlotting tool for various file formats like ASCII, CDF and NetCDF
Running RealityHistorical 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: applet2fig2
Figure 2: Enabling Web Start in NetBeansIDE
Click on Enable Web Start and select “CodeBase” as Local Execution. After that click on “Customize…” under “Signing” and select “Self Sign by generated key”. Now, select “Mixed Code” as “Enable Software Protections”. After this click “OK”: applet2fig3
Figure 3: Enabling Web Start and signing
Build the project to Test Java Web Start Locally. Now you can notice some changes under directory i.e. two new files gets created(launch.html and launch.jnlp) with AmitJavaApplication project jar file “AmitJavaApplication.jar”: applet2fig4
Figure 4: Directory Structure changes after building AmitJavaApplication
As shown above for Java Web Start, three files get created:
  • 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.
To Test Web Start from any other location, copy the above shown three files in your WebApplicationProject for running WebStart from any other location. After copying the directory looks like this for “AmitWebApplication”: applet2fig5
Figure 5: AmitWebApplication Directory Structure
Run the project and open launch.html, the following page will be visible after execution: Link: http://localhost:8080/AmitWebApplication/launch.html applet2fig6
Figure 6: Executing launch.html
Click on Launch, after this you will be given an option to download launch.jnlp file. Download this file at any location on your system: applet2fig7
Figure 7: Downloading Web Start Software launch.jnlp
Now, double-click on “launch.jnlp” and you can see that the same Applet is visible using Web Start as an independent software. This working shows that it is not running under browser as shown in my previous article. So, this is an alternative way to provide users with an option to download software and run it: applet2fig8
Figure 8: Applet visible outside browser

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:
    1. Swing components are not implemented by platform-specific code, they are written entirely in Java and therefore are platform-independent unlike AWT components,
    2. It has more flexible components than AWT.
    3. In J2SE 1.2, Swings superseded AWT’s widgets as it provides a richer set of UI widgets.
    4. Swing draws its own widgets
    5. 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. applet2fig9
Figure 9: Next Generation Java Plug-in features as mentioned at Oracle Java Website
Java SE 7 Update 10 Security Enhancements as stated at Oracle Java Website: The ability to select the desired level of security for unsigned applets, Java Web Start applications, and embedded JavaFX applications that run in a browser. Four levels of security are supported. This feature can be set in the Java Control Panel or (on Microsoft Windows platform only) using a command-line install argument. Java SE 7 Update 21 This update was related to Java Applet & Web Start – Code Signing was done for the best user experience.”As stated at Oracle Java Website: “Starting with Java SE 7 Update 21 in April 2013 all Java Applets and Web Start Applications are encouraged to be signed with a trusted certificate. These steps will significantly lower risks to desktop users. We are also removing the “low” security settings in the Java Control Panel (e.g., low/custom), to prevent users to from inadvertently opting-out entirely from the security remediation we are building into Java. Users will be better protected by maintaining up-to-date versions of the JRE on their systems, combined with requiring code that is signed by a Trusted Certificate Authority (rather than self-signed or unsigned code). “ Dialog messages Dialog messages were changed for Unsigned, Self-signed and Signed Applets. This is explained here. Dialog messages as stated at Oracle Java Website “Specifically, all Java code executed within the client’s browser will prompt the user. The type of dialog messages presented depends upon risk factors like, code signed or unsigned, code requesting elevate privileges, JRE is above or below the security baseline, etc. Low risk scenarios present a very minimal dialog and include a checkbox to not display similar dialogs by the same vendor in the future. Higher risk scenarios, such as running unsigned jars, will require more user interaction given the increased risk.” Java Control Panel As shown in “Java SE 7 Update 21”, “low” security settings in Java Control Panel were removed. Here, I am demonstrating that how Java Control Panel can be accessed in Windows7-32bit to check the current Security Levels and even changing it: Java Control Panel can be accessed when“javacpl.exe” is executed from jre bin folder applet2fig10
Figure 10: Accessing Java Control Panel from command prompt
applet2fig11
Figure 11: Java Control Panel Security Levels
Java SE 7 Update 25: Java Applet & Web Start – Code Signing As stated by Oracle Java: “all files must be added to JARs prior to signing” and “A More Information link is added to the various security dialogs that may pop up prior to launching an Applet or Java Web Start as a means for the user to get more information about the dialog.” Java SE 7 Update 40: Deployment Rule set As stated at Oracle Java: “Deployment Rule Set allowed a desktop administrator to control the level of client compatibility and default prompts across an organization.” Rich Internet Application Deployment Process Introduction of Deployment Rule Set Java SE 7 Update 51 (scheduled in January 2014) This gives some updates to be scheduled in Java 7 Update 51: applet2fig12
Figure 12: Java SE7 Update 51
Blocked or mixed code What to do if your applet is blocked or warns of “mixed code”? Self signed certificates To help users that needs to use self-signed certificates without involving a public Certificate Authority. Describes the role of code signing. New security requirements for RIAs in 7u51 (January 2014) https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias Security Resource Center by Oracle for Developers, End-Users, System Administrators and Security Professionals
http://www.oracle.com/technetwork/java/javase/overview/security-2043272.html

Websites using Applets

Mathematical Applets applet2fig13
Figure 13: Larry Green’s Applet Page: http://www.ltcconline.net/greenL/java/index.html
Tested Applets for more security applet2fig14
Figure 14: Another Java Applet Page: http://lionsgate.tripod.com/
Educational Java Applets applet2fig15
Figure 15: Mathematics, Physics and Engineering Applets: http://www.falstad.com/mathphysics.html
The above given site also provides link for other websites which uses Applet. Content as stated on the website: ”Links to other educational sites with math/physics-related information or java applets useful for teaching”: applet2fig16
Figure 16: Links to other sites: http://www.falstad.com/mathphysics.html
Sample Size Calculator Applet applet2fig17
Figure 17: Sample Survey Resources Applet: http://design.iasri.res.in/ssrs/ecalci2.jsp
Java Applet: Word Magnets Scramble applet2fig18
Figure 18: Word Magnets Scramble: http://web.cortland.edu/flteach/mm-course/wordscrambleapplets/index.html
DAEJA viewONE pro applet2fig19
Figure 19: DAEJA viewONE pro: http://www.daeja.com/demo/viewone-pro-demo-list.asp
Interactive Java Applets applet2fig20
Figure 20: Interactive Java Applets
• You can add Applets given on this website to your website • To conclude, providing list of Applets around World Wide Web(WWW). The below given screenshot is taken from http://www.montgomerycollege.edu/~dsolomon/273/ca273y/java/resources.html: applet2fig21
Figure 21: List of Applets around WWW

Conclusion

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 DiwanAmit Diwan
View Author

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.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form