KEMBAR78
JAVA APPLETS | PDF
JAVA APPLETS
RAMKRISHNA BHAGAT
CONTENT
2
▰ Introduction
▰ Why we use
▰ Applet Life-Cycle
▰ Advantage & Dis-Advantage of Applets
Applet
3
1
“Applet is a special type of
program that is embedded in the
webpage to generate the
dynamic content.
44
Continued..
▰ It runs inside the browser and works at client side.
▰ Applets in Java are small and dynamic internet-based programs.
▰ Plug-in is required at client browser to execute applet.
▰ It works at client side so less response time.
▰ A Java Applet can be only executed within the applet framework of Java.
5
Why we use Applets
▰ Java Applets are usually used to add small, interactive
components or enhancements to a webpage. These may consist
of buttons, scrolling text, or stock tickers, but they can also be
used to display larger programs like word processors or games.
6
Applet Life Cycle
7
MAPS
8
Example
9
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hello World!", 50, 25);
}
}
<html>
<head>
<TITLE> A Simple Program</TITLE>
</head>
<body> Here is the output of my
program:
<applet code="HelloWorld.class"
width="150" height="25"></applet>
</body>
</html>
Advantages & Disadvantages
Advantage
▰ It is simple to make it work on Linux,
Windows and Mac OS i.e. cross platform.
▰ The same Applet can work on all installed
versions of JAVA at the same time.
▰ It can move the work from server to the
client.
▰ Secured:- An un-trusted applet has no
access to the local machine and can only
access the server it came from.
▰ Java applets are fast.
Disadvantage
▰ It requires the java plug-in.
▰ Some browsers, notably mobile
browsers like Apple iOS or Android
do not run the java applets at all.
▰ Some applets require a specific JRE.
10
References :
▰ https://www.sitesbay.com/java/java-applet
▰ https://www.tutorialspoint.com/java/java/applet/basics.html
11
Thanks!
You have any questions..?
ramkrishnabhagat044@gmail.com
12

JAVA APPLETS

  • 1.
  • 2.
    CONTENT 2 ▰ Introduction ▰ Whywe use ▰ Applet Life-Cycle ▰ Advantage & Dis-Advantage of Applets
  • 3.
  • 4.
    “Applet is aspecial type of program that is embedded in the webpage to generate the dynamic content. 44
  • 5.
    Continued.. ▰ It runsinside the browser and works at client side. ▰ Applets in Java are small and dynamic internet-based programs. ▰ Plug-in is required at client browser to execute applet. ▰ It works at client side so less response time. ▰ A Java Applet can be only executed within the applet framework of Java. 5
  • 6.
    Why we useApplets ▰ Java Applets are usually used to add small, interactive components or enhancements to a webpage. These may consist of buttons, scrolling text, or stock tickers, but they can also be used to display larger programs like word processors or games. 6
  • 7.
  • 8.
  • 9.
    Example 9 import java.applet.Applet; import java.awt.Graphics; publicclass HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello World!", 50, 25); } } <html> <head> <TITLE> A Simple Program</TITLE> </head> <body> Here is the output of my program: <applet code="HelloWorld.class" width="150" height="25"></applet> </body> </html>
  • 10.
    Advantages & Disadvantages Advantage ▰It is simple to make it work on Linux, Windows and Mac OS i.e. cross platform. ▰ The same Applet can work on all installed versions of JAVA at the same time. ▰ It can move the work from server to the client. ▰ Secured:- An un-trusted applet has no access to the local machine and can only access the server it came from. ▰ Java applets are fast. Disadvantage ▰ It requires the java plug-in. ▰ Some browsers, notably mobile browsers like Apple iOS or Android do not run the java applets at all. ▰ Some applets require a specific JRE. 10
  • 11.
    References : ▰ https://www.sitesbay.com/java/java-applet ▰https://www.tutorialspoint.com/java/java/applet/basics.html 11
  • 12.
    Thanks! You have anyquestions..? ramkrishnabhagat044@gmail.com 12