SlideShare uma empresa Scribd logo
1 de 18
Applets in Java
Not Apples
Presented By: Wani Zahoor
Introduction
 Applet is small java program that can be easily
transported over the network from one
computer to other.
 used in internet applications.
 embedded in an html page, can be downloaded
from the server and run on the client, so as to
do a specific kind of job.
Types of Java Programmes
 Standalone
 Web based
Stand Alone Program
Web-Based Program
Difference between an
applet and application
APPLET CLASS
 java.applet.Applet is the
super class of the all the
applets.
 Applet class has a
predefined hierarchy
Applet Example
import java.applet.*;
import java.awt.*;
public class FirstApplet extends Applet {
public void paint(Graphics g) {
g.drawString(“Welcome in Applets”,10,50);
}
}
The Output
Applet Life cycle
 An applet may move from one state to another
depending upon a set of default behaviours inherited in
the form of methods from ‘Applet’ class.
 These states are
 Born
 Running
 Idle
 Dead
Applet State Diagram
Life cycle of Applet
 init() –
 creates the objects needed by the applet;
 sets up initial values, load font and images or set up colors.
 called only once during the lifetime of on Applet.
 start()-
 moves to this phase automatically after the initialization state.
 if the applet is stopped or it goes to idle state, start() method must be called in
order to force the applet again to the running state.
 paint() -
 This method is called each time to draw and redraw the output of an applet.
 stop()-
 idle state, once it is stopped from running
 destroy()-
 An applet goes to dead state when it is destroyed by invoking the destroy() method
of Applet class.
 It results in complete removal of applet from the memory.
Common Methods drawString()-
 member of Graphics class, used to output a string to an applet.
 It is typically called from within the paint() or update() method.
 void drawString(String msg,int a, int b)
 setBackground() & getBackground()
 belongs to Component class, used to set and get the background color.
 void setBackground(Color anyColor)
 predefined constants for each color, such as Color.red can be used.
 setForeground() & get Foreground()
 set and gets the color of the text to be displayed on the foreground of the
applet window.
 void setForeground(Color anyColor)
 showStatus()
 display any string in the status window of the browser
 void showString(String text)
Graphics class
import java.awt.* ;
import java.applet.* ;
public class DrawLineRect extends Applet {
public void paint(Graphics g){
g.drawRect(10,60,40,30);
g.fillRect(60,10,30,80);
g.fillOval(140,160,170,170);
g.drawRoundRect(10,100,80,50,10,10);
g.fillRoundRect(20,110,60,30,5,5);
g.drawArc(280,210,250,220,30,90);
g.drawLine(100,10,230,140);
g.drawLine(100,140,230,10);
}}
The Output
Now your turn..!!!
 How to programme this…..????
HTML Tag
<applet code="Bubbles.class" width="350" height="350">
</applet>
Applets in java

Mais conteúdo relacionado

Mais procurados

Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
kamal kotecha
 

Mais procurados (20)

java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
Java package
Java packageJava package
Java package
 
Java swing
Java swingJava swing
Java swing
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Files in java
Files in javaFiles in java
Files in java
 
Applet programming
Applet programming Applet programming
Applet programming
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Java IO
Java IOJava IO
Java IO
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
Java threads
Java threadsJava threads
Java threads
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Control structures in java
Control structures in javaControl structures in java
Control structures in java
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 

Destaque

Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
backdoor
 
Basics of applets.53
Basics of applets.53Basics of applets.53
Basics of applets.53
myrajendra
 
Thread model of java
Thread model of javaThread model of java
Thread model of java
myrajendra
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
Benj Del Mundo
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
Deepak Sharma
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Estructura de datos: lista, pilas y colas
Estructura de datos: lista, pilas y colasEstructura de datos: lista, pilas y colas
Estructura de datos: lista, pilas y colas
Huascar Génere
 

Destaque (20)

Java Applet and Graphics
Java Applet and GraphicsJava Applet and Graphics
Java Applet and Graphics
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 applets
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
 
Satish training ppt
Satish training pptSatish training ppt
Satish training ppt
 
Basics of applets.53
Basics of applets.53Basics of applets.53
Basics of applets.53
 
Srgoc java
Srgoc javaSrgoc java
Srgoc java
 
L5 classes, objects, nested and inner class
L5 classes, objects, nested and inner classL5 classes, objects, nested and inner class
L5 classes, objects, nested and inner class
 
Thread model of java
Thread model of javaThread model of java
Thread model of java
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and Concurrency
 
L18 applets
L18 appletsL18 applets
L18 applets
 
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
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
Jsp
JspJsp
Jsp
 
Java Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresJava Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data Structures
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
Estructura de datos: lista, pilas y colas
Estructura de datos: lista, pilas y colasEstructura de datos: lista, pilas y colas
Estructura de datos: lista, pilas y colas
 

Semelhante a Applets in java

Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
Abhishek Khune
 

Semelhante a Applets in java (20)

Applet in java new
Applet in java newApplet in java new
Applet in java new
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Oops
OopsOops
Oops
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
Applet
AppletApplet
Applet
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
 
Applet progming
Applet progmingApplet progming
Applet progming
 
Applet
AppletApplet
Applet
 
Graphics programming in Java
Graphics programming in JavaGraphics programming in Java
Graphics programming in Java
 
Java Applet
Java AppletJava Applet
Java Applet
 
java programming - applets
java programming - appletsjava programming - applets
java programming - applets
 
Smart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfSmart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdf
 
Smart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfSmart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdf
 
oops with java modules iii & iv.pptx
oops with java modules iii & iv.pptxoops with java modules iii & iv.pptx
oops with java modules iii & iv.pptx
 
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
 
Java applet
Java appletJava applet
Java applet
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
 
Applet &amp; graphics programming
Applet &amp; graphics programmingApplet &amp; graphics programming
Applet &amp; graphics programming
 

Mais de Wani Zahoor (6)

VPN Network
VPN NetworkVPN Network
VPN Network
 
Java threads
Java threadsJava threads
Java threads
 
DotNet Framework
DotNet FrameworkDotNet Framework
DotNet Framework
 
Deadlocks by wani zahoor
Deadlocks by wani zahoorDeadlocks by wani zahoor
Deadlocks by wani zahoor
 
Antennas in Wireless Communication
Antennas in Wireless CommunicationAntennas in Wireless Communication
Antennas in Wireless Communication
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 

Último

Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
anilsa9823
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 

Último (20)

Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 

Applets in java

  • 1. Applets in Java Not Apples Presented By: Wani Zahoor
  • 2. Introduction  Applet is small java program that can be easily transported over the network from one computer to other.  used in internet applications.  embedded in an html page, can be downloaded from the server and run on the client, so as to do a specific kind of job.
  • 3. Types of Java Programmes  Standalone  Web based
  • 7. APPLET CLASS  java.applet.Applet is the super class of the all the applets.  Applet class has a predefined hierarchy
  • 8. Applet Example import java.applet.*; import java.awt.*; public class FirstApplet extends Applet { public void paint(Graphics g) { g.drawString(“Welcome in Applets”,10,50); } }
  • 10. Applet Life cycle  An applet may move from one state to another depending upon a set of default behaviours inherited in the form of methods from ‘Applet’ class.  These states are  Born  Running  Idle  Dead
  • 12. Life cycle of Applet  init() –  creates the objects needed by the applet;  sets up initial values, load font and images or set up colors.  called only once during the lifetime of on Applet.  start()-  moves to this phase automatically after the initialization state.  if the applet is stopped or it goes to idle state, start() method must be called in order to force the applet again to the running state.  paint() -  This method is called each time to draw and redraw the output of an applet.  stop()-  idle state, once it is stopped from running  destroy()-  An applet goes to dead state when it is destroyed by invoking the destroy() method of Applet class.  It results in complete removal of applet from the memory.
  • 13. Common Methods drawString()-  member of Graphics class, used to output a string to an applet.  It is typically called from within the paint() or update() method.  void drawString(String msg,int a, int b)  setBackground() & getBackground()  belongs to Component class, used to set and get the background color.  void setBackground(Color anyColor)  predefined constants for each color, such as Color.red can be used.  setForeground() & get Foreground()  set and gets the color of the text to be displayed on the foreground of the applet window.  void setForeground(Color anyColor)  showStatus()  display any string in the status window of the browser  void showString(String text)
  • 14. Graphics class import java.awt.* ; import java.applet.* ; public class DrawLineRect extends Applet { public void paint(Graphics g){ g.drawRect(10,60,40,30); g.fillRect(60,10,30,80); g.fillOval(140,160,170,170); g.drawRoundRect(10,100,80,50,10,10); g.fillRoundRect(20,110,60,30,5,5); g.drawArc(280,210,250,220,30,90); g.drawLine(100,10,230,140); g.drawLine(100,140,230,10); }}
  • 16. Now your turn..!!!  How to programme this…..????
  • 17. HTML Tag <applet code="Bubbles.class" width="350" height="350"> </applet>