SlideShare a Scribd company logo
1 of 23
Java Applets
By – NiTiN BiRaRi
Applet Programming
• local and remote applets
• difference between applet and application
• applet life cycle
• developing executable applet code
Applet Introduction
• Applets are small Java programs that are used
in Internet computing
• Applets,
– Transported over the Internet
– Automatically installed in client machine
– Run as part of a web document
– Applets can be run using a tool ‘appletviewer’
• Applets interact with the user through the
AWT, not through the console-based I/O
classes
• Browser runs applet in a Java Virtual Machine
(JVM)
local and remote applets
• Applets can be classified into two types…
– Local applets
– Remote applets
• Local applet
– Developed and stored in local system
– No need for internet connection for the local
system
– Local directories were searched to locate the
specified applet
• Remote applet
– Developed by someone else
– Stored on a remote computer connected to the
internet
– Our system needs an internet connection
– The applet is downloaded into our local system via
internet
– Run it on our system
• init: This method is intended for whatever
initialization is needed for your applet. It is
called after the param tags inside the applet
tag have been processed.
• start: This method is automatically called after
the browser calls the init method. It is also
called whenever the user returns to the page
containing the applet after having gone off to
other pages.
• stop: This method is automatically called when
the user moves off the page on which the applet
sits. It can, therefore, be called repeatedly in the
same applet.
• destroy: This method is only called when the
browser shuts down normally. Because applets
are meant to live on an HTML page, you should
not normally leave resources behind after a user
leaves the page that contains the applet.
• paint: Invoked immediately after the start()
method, and also any time the applet needs
to repaint itself in the browser. The paint()
method is actually inherited from the
java.awt.
developing executable applet code
• Let’s begin with the simple applet shown here:
import java.awt.*;
import java.applet.*;
public class SimpleApplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
• compile in the same way
• there are two ways in which you can run an
applet:
– Executing the applet within a Java-compatible web
browser.
– Using an applet viewer
HTML APPLET Tag
• CODEBASE is an optional attribute that
specifies the base URL of the applet code
• CODE is a required attribute that gives the
name of the file containing your applet’s
compiled .class file
• ALT tag is an optional attribute used to specify
a short text message that should be displayed
if the browser recognizes the APPLET tag but
can’t currently run Java applets
• NAME is an optional attribute used to specify
a name for the applet instance
• WIDTH and HEIGHT are required attributes
that give the size (in pixels) of the applet
display area
• ALIGN is an optional attribute that specifies
the alignment of the applet
• VSPACE specifies the space, in pixels, above
and below the applet
• HSPACE specifies the space, in pixels, on each
side of the applet
• PARAM tag allows you to specify applet-
specific arguments
• Some Points About Applets…
– Applets are event driven
– Applets do not use main() method
– They run in a browser
– They cannot read or write the files from the local
system
– Applets cannot run any other program from the
local computer
Applet class methods
• destroy()
Called by the browser or applet viewer to inform this applet that it is
being reclaimed and that it should destroy any resources that it has allocated.
• getAppletContext()
Determines this applet's context, which allows the applet to query
and affect the environment in which it runs.
• getAppletInfo()
Returns information about this applet.
• getAudioClip(URL)
Returns the AudioClip object specified by the URL argument.
• getAudioClip(URL, String)
Returns the AudioClip object specified by the URL and name
arguments.
• getCodeBase()
Gets the base URL.
• getDocumentBase()
Gets the document URL.
• getImage(URL)
Returns an Image object that can then be painted on the
screen.
• getImage(URL, String)
Returns an Image object that can then be painted on the
screen.
• getLocale()
Gets the Locale for the applet, if it has been set.
• getParameter(String)
Returns the value of the named parameter in the HTML tag.
• getParameterInfo()
Returns information about the parameters than are
understood by this applet.
• init()
Called by the browser or applet viewer to inform this applet
that it has been loaded into the system.
• isActive()
Determines if this applet is active.
• play(URL)
Plays the audio clip at the specified absolute URL.
• play(URL, String)
Plays the audio clip given the URL and a specifier that is
relative to it.
• resize(Dimension)
Requests that this applet be resized.
• resize(int, int)
Requests that this applet be resized.
• setStub(AppletStub)
Sets this applet's stub.
• showStatus(String)
Requests that the argument string be displayed in the "status
window".
• start()
Called by the browser or applet viewer to inform this applet that it
should start its execution.
• stop()
Called by the browser or applet viewer to inform this applet that it
should stop its execution.
Component class method
• void setBackground(Color newColor)
• void setForeground(Color newColor)
• Color getBackground( )
• Color getForeground( )
Can you?
• Explain concept of applet life cycle.
• Differentiate applet and application.
• Develop code for simple Java applets.
• Explain applet tag and its parameter.
• Use the methods of the applet and
component classes required for a basic applet.

More Related Content

What's hot

Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control UnitKamal Acharya
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationSanjeev Patel
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInteX Research Lab
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipeliningMazin Alwaaly
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2Dr.MAYA NAYAK
 
Computer architecture
Computer architectureComputer architecture
Computer architectureZuhaib Zaroon
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.mali yogesh kumar
 
Prediction Model for Emotion Recognition Using EEG
Prediction Model for Emotion Recognition Using EEGPrediction Model for Emotion Recognition Using EEG
Prediction Model for Emotion Recognition Using EEGIRJET Journal
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notesDr.YNM
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04thearticlenow
 

What's hot (20)

Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control Unit
 
Presentation on risc pipeline
Presentation on risc pipelinePresentation on risc pipeline
Presentation on risc pipeline
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 
3 Pipelining
3 Pipelining3 Pipelining
3 Pipelining
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Pipelining in computer architecture
Pipelining in computer architecturePipelining in computer architecture
Pipelining in computer architecture
 
Loaders
LoadersLoaders
Loaders
 
Pipelining
PipeliningPipelining
Pipelining
 
stack in assembally language
stack in assembally languagestack in assembally language
stack in assembally language
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
Instruction pipelining
Instruction pipeliningInstruction pipelining
Instruction pipelining
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Computer Architecture and organization ppt.
Computer Architecture and organization ppt.Computer Architecture and organization ppt.
Computer Architecture and organization ppt.
 
Prediction Model for Emotion Recognition Using EEG
Prediction Model for Emotion Recognition Using EEGPrediction Model for Emotion Recognition Using EEG
Prediction Model for Emotion Recognition Using EEG
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notes
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04
 

Viewers also liked

Viewers also liked (8)

Asif
AsifAsif
Asif
 
21servers And Applets
21servers And Applets21servers And Applets
21servers And Applets
 
Java Servlet
Java Servlet Java Servlet
Java Servlet
 
Applet Vs Servlet
Applet Vs ServletApplet Vs Servlet
Applet Vs Servlet
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Java Applet
Java AppletJava Applet
Java Applet
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 

Similar to Applet intro

Similar to Applet intro (20)

Java applet
Java appletJava applet
Java applet
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
PROGRAMMING IN JAVA- unit 4-part I
PROGRAMMING IN JAVA- unit 4-part IPROGRAMMING IN JAVA- unit 4-part I
PROGRAMMING IN JAVA- unit 4-part I
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Applets
AppletsApplets
Applets
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 
6applets And Graphics
6applets And Graphics6applets And Graphics
6applets And Graphics
 
Applets
AppletsApplets
Applets
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
 
Applet.pptx
Applet.pptxApplet.pptx
Applet.pptx
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Java applet
Java appletJava applet
Java applet
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
java programming - applets
java programming - appletsjava programming - applets
java programming - applets
 

Recently uploaded

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
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...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
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
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Applet intro

  • 1. Java Applets By – NiTiN BiRaRi
  • 2. Applet Programming • local and remote applets • difference between applet and application • applet life cycle • developing executable applet code
  • 3. Applet Introduction • Applets are small Java programs that are used in Internet computing • Applets, – Transported over the Internet – Automatically installed in client machine – Run as part of a web document – Applets can be run using a tool ‘appletviewer’
  • 4. • Applets interact with the user through the AWT, not through the console-based I/O classes • Browser runs applet in a Java Virtual Machine (JVM)
  • 5. local and remote applets • Applets can be classified into two types… – Local applets – Remote applets • Local applet – Developed and stored in local system – No need for internet connection for the local system – Local directories were searched to locate the specified applet
  • 6. • Remote applet – Developed by someone else – Stored on a remote computer connected to the internet – Our system needs an internet connection – The applet is downloaded into our local system via internet – Run it on our system
  • 7.
  • 8. • init: This method is intended for whatever initialization is needed for your applet. It is called after the param tags inside the applet tag have been processed. • start: This method is automatically called after the browser calls the init method. It is also called whenever the user returns to the page containing the applet after having gone off to other pages.
  • 9. • stop: This method is automatically called when the user moves off the page on which the applet sits. It can, therefore, be called repeatedly in the same applet. • destroy: This method is only called when the browser shuts down normally. Because applets are meant to live on an HTML page, you should not normally leave resources behind after a user leaves the page that contains the applet.
  • 10. • paint: Invoked immediately after the start() method, and also any time the applet needs to repaint itself in the browser. The paint() method is actually inherited from the java.awt.
  • 11. developing executable applet code • Let’s begin with the simple applet shown here: import java.awt.*; import java.applet.*; public class SimpleApplet extends Applet { public void paint(Graphics g) { g.drawString("A Simple Applet", 20, 20); } }
  • 12. • compile in the same way • there are two ways in which you can run an applet: – Executing the applet within a Java-compatible web browser. – Using an applet viewer
  • 14. • CODEBASE is an optional attribute that specifies the base URL of the applet code • CODE is a required attribute that gives the name of the file containing your applet’s compiled .class file • ALT tag is an optional attribute used to specify a short text message that should be displayed if the browser recognizes the APPLET tag but can’t currently run Java applets
  • 15. • NAME is an optional attribute used to specify a name for the applet instance • WIDTH and HEIGHT are required attributes that give the size (in pixels) of the applet display area • ALIGN is an optional attribute that specifies the alignment of the applet • VSPACE specifies the space, in pixels, above and below the applet
  • 16. • HSPACE specifies the space, in pixels, on each side of the applet • PARAM tag allows you to specify applet- specific arguments
  • 17. • Some Points About Applets… – Applets are event driven – Applets do not use main() method – They run in a browser – They cannot read or write the files from the local system – Applets cannot run any other program from the local computer
  • 18. Applet class methods • destroy() Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated. • getAppletContext() Determines this applet's context, which allows the applet to query and affect the environment in which it runs. • getAppletInfo() Returns information about this applet. • getAudioClip(URL) Returns the AudioClip object specified by the URL argument. • getAudioClip(URL, String) Returns the AudioClip object specified by the URL and name arguments. • getCodeBase() Gets the base URL.
  • 19. • getDocumentBase() Gets the document URL. • getImage(URL) Returns an Image object that can then be painted on the screen. • getImage(URL, String) Returns an Image object that can then be painted on the screen. • getLocale() Gets the Locale for the applet, if it has been set. • getParameter(String) Returns the value of the named parameter in the HTML tag.
  • 20. • getParameterInfo() Returns information about the parameters than are understood by this applet. • init() Called by the browser or applet viewer to inform this applet that it has been loaded into the system. • isActive() Determines if this applet is active. • play(URL) Plays the audio clip at the specified absolute URL. • play(URL, String) Plays the audio clip given the URL and a specifier that is relative to it.
  • 21. • resize(Dimension) Requests that this applet be resized. • resize(int, int) Requests that this applet be resized. • setStub(AppletStub) Sets this applet's stub. • showStatus(String) Requests that the argument string be displayed in the "status window". • start() Called by the browser or applet viewer to inform this applet that it should start its execution. • stop() Called by the browser or applet viewer to inform this applet that it should stop its execution.
  • 22. Component class method • void setBackground(Color newColor) • void setForeground(Color newColor) • Color getBackground( ) • Color getForeground( )
  • 23. Can you? • Explain concept of applet life cycle. • Differentiate applet and application. • Develop code for simple Java applets. • Explain applet tag and its parameter. • Use the methods of the applet and component classes required for a basic applet.