PROGRAM-8
AIM:- Write a program to demonstrate the concept of applet.
Overview;
Java applets were small applications written in the Java programming language
that could be embedded in web pages and run within a web browser. They were
originally used to add interactivity, multimedia, and dynamic content to websites.
Java applets were popular in the late 1990s and early 2000s but have largely been
replaced by newer web technologies due to security concerns and changes in
browser support.
Purpose:
• Java applets were designed to be platform-independent, meaning they
could run on any operating system that had a Java Virtual Machine (JVM)
installed.
• They were often used for interactive web applications, games, charts,
scientific simulations, and multimedia presentations on websites.
How They Worked:
• Applets were embedded in HTML pages using the <applet> tag (in older
browsers) or <object> tag.
• The browser would download the applet and run it inside a special "applet
viewer" or applet container provided by the JVM.
• Applets had restricted access to system resources for security reasons,
operating in a "sandbox" environment.
End of Java Applets:
• As of 2015, Oracle officially deprecated Java applets and the NPAPI
plugin, and by 2017, most browsers stopped supporting them entirely.
• Applets are now considered obsolete in favor of modern web development
standards.
Code:
import javax.swing.JFrame; import
javax.swing.JLabel; import
javax.swing.SwingConstants;
public class program_8 { public static
void main(String[] args) {
JFrame frame = new JFrame("Dev ‘s Apple Application");
JLabel label = new JLabel("Hello, World!", SwingConstants.CENTER);
frame.add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
frame.setVisible(true);
OUTPUT