presentation21 - Instantiate Initialize Start Stop Destroy...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Applets Soheil Hassas Yeganeh Computer Engineering Department Sharif University of Technology
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Applets 2
Background image of page 2
Applets Applet means a small application . Applet is the most popular way to create small platform independent applications . Applets are embedded in web pages. 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How? 3
Background image of page 4
How? To create an applet Extend the java.applet.Applet and override some methods. Create a HTML fle to embed the applet in. 3
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Applet Class
Background image of page 6
java.applet.Applet has following methods init() start() paint() stop() destroy() Applets are instantiated using the default constructor. It is “init”ed , then it will be “start” ed. Now it can “paint” itself, until, it is “stop” ed. It can be “start” ed again, or it can be “destroy” ed. 4 Applet Class
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Process 5 Load
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Instantiate Initialize Start Stop Destroy 6 HTML File <applet code="TestApplet.class" height=150 width=300> </applet> • After creating an applet you have to create an html to view it. • You can use the <applet> tag to view your applet. • “code” attribute is the class Fle of your applet. • Now you can use the appletviewer program to view your html. 6 HTML ±ile <applet code="TestApplet.class" height=150 width=300> </applet> 7 paint on Graphics • java.awt.Graphics is class that should be used to paint on. • Each Component object has a Graphics object attached. • You can draw shapes , strings , and images . • Let’s see some examples. 7 paint on Graphics Any Questions?...
View Full Document

Page1 / 13

presentation21 - Instantiate Initialize Start Stop Destroy...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online