SlideShare uma empresa Scribd logo
1 de 16
• An applet is a Panel that allows interaction with a Java program
• A applet is typically embedded in a Web page and can be run
from a browser
• You need special HTML in the Web page to tell the browser
about the applet
• For security reasons, applets run in a sandbox: they have no
access to the client’s file system
• Most modern browsers support Java 1.4 if they have the
appropriate plug-in
• A programmer should be able to write applets that can run on
any browser
Applet are not full featured application program. They are usually written to a
accomplish a small task or a component of a task. Since they are usually designed
for use on the internet, they impose certain limitation and restrictions in their
design .
1.Applets do not use the main() method for initiating the execution of the code.
Applets, when loaded, automatically call certain methods of Applet class to start
and execute the applet code.
2. Unlike stand-alone applications, applets can not be run independently. They
have to be embedded inside a web page to get using a special feature known as
HTML tag.
3. Applets can only be executed inside the web browser of appletviewer.
4. Applets can not read from or write to the files on the local computer
5. Applet can not communicate with the other servers on the network.
6. Applet can not run any program from the local computer.
7. Applet are restricted from using libraries from other languages such as C or C++.
(java language supports this feature through native methods)
Born
Running
Idle Dead
Begin
init()()
paint()
start()()
stop()()
destroy()()
End
Applets have 4 life cycle methods. They are:
init() – It is called to initialize the applet before it gets
loaded
start() – It is called to provide start up behavior
stop() – Called to stop any operations which are started
using start() method.
destroy() – Is called when an applet has finished execution.
 ‘init’ and ‘destroy’ are only called
once each
 ‘start’ and ‘stop’ are called
whenever the browser enters and
leaves the page
 ‘do some work’ is code called by
your listeners
 ‘paint’ is called when the applet
needs to be repainted
• Needed if you do any drawing or painting other than
just using standard GUI Components.
• Any painting you want to do should be done here, or in
a method you call from here.
• Painting that you do in other methods may or may not
happen.
• Never call paint(Graphics), call repaint( ).
Call repaint( ) when you have changed something
and want your changes to show up on the screen
repaint( ) is a request--it might not happen
When you call repaint( ), Java schedules a call to
update(Graphics g)
g.drawString(“Hello”, 20, 20); Hello
g.drawRect(x, y, width, height);
g.fillRect(x, y, width, height);
g.drawOval(x, y, width, height);
g.fillOval(x, y, width, height);
g.setColor(Color.red);
<html>
<body>
<applet code="ball1.class" width=200
height=200>
</applet>
</body>
</html>
ADVANTAGES
Applets are cross platform and can run on Windows, Mac OS and
Linux platform
Applets can work on all the versions of Java Plug-in.
Applet runs in a sandbox, so the user doesn’t need to trust the code
and it can work without security approval.
DISADVANTAGES:
Java Plug-in is required to run applet.
Java applet needs JVM so first time it takes significant start-up
time.
Difficult to design and build good user interface in applets
compared to other technologies.
THANK YOU

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Applet programming
Applet programming Applet programming
Applet programming
 
Java applets
Java appletsJava applets
Java applets
 
Basics of applets.53
Basics of applets.53Basics of applets.53
Basics of applets.53
 
Applet progming
Applet progmingApplet progming
Applet progming
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
 
JAVA APPLETS
JAVA APPLETSJAVA APPLETS
JAVA APPLETS
 
Java applets
Java appletsJava applets
Java applets
 
Applet
AppletApplet
Applet
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Java Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet ProgramsJava Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet Programs
 
Applet
AppletApplet
Applet
 
first-applet
first-appletfirst-applet
first-applet
 
Applets_Basic Introduction
Applets_Basic IntroductionApplets_Basic Introduction
Applets_Basic Introduction
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
Testing Native Apps at PAYBACK
Testing Native Apps at PAYBACKTesting Native Apps at PAYBACK
Testing Native Apps at PAYBACK
 
Get the Top 6 new features in Java 2019
Get the Top 6 new features in Java 2019Get the Top 6 new features in Java 2019
Get the Top 6 new features in Java 2019
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
Appium@Work at PAYBACK
Appium@Work at PAYBACKAppium@Work at PAYBACK
Appium@Work at PAYBACK
 
3. applets
3. applets3. applets
3. applets
 

Semelhante a Applet (20)

Applets
AppletsApplets
Applets
 
Applets
AppletsApplets
Applets
 
Applets
AppletsApplets
Applets
 
Applets
AppletsApplets
Applets
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
 
Applets
AppletsApplets
Applets
 
Java applet
Java appletJava applet
Java applet
 
Applets
AppletsApplets
Applets
 
Applet in JAVA
Applet in JAVAApplet in JAVA
Applet in JAVA
 
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
 
Applet.pptx
Applet.pptxApplet.pptx
Applet.pptx
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
 
Applet
AppletApplet
Applet
 
Applet programming1
Applet programming1Applet programming1
Applet programming1
 
Till applet skeleton
Till applet skeletonTill applet skeleton
Till applet skeleton
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 

Último

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 

Último (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

Applet

  • 1.
  • 2. • An applet is a Panel that allows interaction with a Java program • A applet is typically embedded in a Web page and can be run from a browser • You need special HTML in the Web page to tell the browser about the applet • For security reasons, applets run in a sandbox: they have no access to the client’s file system • Most modern browsers support Java 1.4 if they have the appropriate plug-in • A programmer should be able to write applets that can run on any browser
  • 3. Applet are not full featured application program. They are usually written to a accomplish a small task or a component of a task. Since they are usually designed for use on the internet, they impose certain limitation and restrictions in their design . 1.Applets do not use the main() method for initiating the execution of the code. Applets, when loaded, automatically call certain methods of Applet class to start and execute the applet code. 2. Unlike stand-alone applications, applets can not be run independently. They have to be embedded inside a web page to get using a special feature known as HTML tag. 3. Applets can only be executed inside the web browser of appletviewer. 4. Applets can not read from or write to the files on the local computer 5. Applet can not communicate with the other servers on the network. 6. Applet can not run any program from the local computer. 7. Applet are restricted from using libraries from other languages such as C or C++. (java language supports this feature through native methods)
  • 5. Applets have 4 life cycle methods. They are: init() – It is called to initialize the applet before it gets loaded start() – It is called to provide start up behavior stop() – Called to stop any operations which are started using start() method. destroy() – Is called when an applet has finished execution.
  • 6.  ‘init’ and ‘destroy’ are only called once each  ‘start’ and ‘stop’ are called whenever the browser enters and leaves the page  ‘do some work’ is code called by your listeners  ‘paint’ is called when the applet needs to be repainted
  • 7.
  • 8. • Needed if you do any drawing or painting other than just using standard GUI Components. • Any painting you want to do should be done here, or in a method you call from here. • Painting that you do in other methods may or may not happen. • Never call paint(Graphics), call repaint( ).
  • 9. Call repaint( ) when you have changed something and want your changes to show up on the screen repaint( ) is a request--it might not happen When you call repaint( ), Java schedules a call to update(Graphics g)
  • 10. g.drawString(“Hello”, 20, 20); Hello g.drawRect(x, y, width, height); g.fillRect(x, y, width, height); g.drawOval(x, y, width, height); g.fillOval(x, y, width, height); g.setColor(Color.red);
  • 11.
  • 13.
  • 14.
  • 15. ADVANTAGES Applets are cross platform and can run on Windows, Mac OS and Linux platform Applets can work on all the versions of Java Plug-in. Applet runs in a sandbox, so the user doesn’t need to trust the code and it can work without security approval. DISADVANTAGES: Java Plug-in is required to run applet. Java applet needs JVM so first time it takes significant start-up time. Difficult to design and build good user interface in applets compared to other technologies.