Your SlideShare is downloading. ×
Java Presentation
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Java Presentation


Published on

Published in: Education

  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


    • APPLET
    • Created By :
    • Prashant Marvania
  • 3. Overview of APPLET
    • What is Applet?
    • Advantages of Applet
    • Disadvantages of Applet
    • The Life Cycle of an Applet
    • The format of <APPLET> tag
    • Attributes of the <APPLET> tag
    • Example of an Applet
  • 4. What is Applet?
    • Applet is a JAVA programme that can be embedded into HTML page.
    • JAVA Applet runs on the java enables web browsers such as MOZILA and INTERNET EXPLORER.
    • Applets are used to make the web site more dynamic and entertaining.
  • 5. Advantages of Applet
    • There are many advantages of Applet:
    • Cross platform and can run on Windows, MacOS and Linux platform.
    • Applet can work all the version of java plugin.
    • Applets run in a sandbox.
    • Applets are supported by most web browsers.
    • Applets are cached in most web browsers.
  • 6. Disadvantages of Applet
    • There are many disadvantages of Applet:
    • Java plug-in is required to run Applet.
    • Java Applet requires JVM.
    • If Applet is not already cached in the machine, it will be downloaded from internet and will take time.
    • Its difficult to design and build good user interface in Applets compared to HTML technology.
  • 7. The Life Cycle of an Applet
    • In Applet, there are 4 methods in Life Cycle:
    • 1.init()
    • 2.start()
    • 3.stop()
    • 4.destroy()
  • 8. Init() and start() methods
    • Init():
    • This method is called to initialized an
    • Applet.
    • Start():
    • This method is called after the
    • initialization of the Applet.
  • 9. Stop() and destroy() methods
    • Stop():
    • This method can be called multiple
    • times in the life cycle of an Applet.
    • Destroy():
    • This method is called only once in
    • the life cycle of an Applet when Applet
    • is destroyed
  • 10. The format of <APPLET> tag
    • <APPLET attributes>
    • applet_parameters
    • alternate_content
    • </APPLET>
  • 11. Attributes of the <APPLET> tag
    • There are many attributes of the <APPLET> tag.
    • 1.CODE = appletFile
    • 2.WIDTH = pixels
    • 3.HEIGHT = pixels
  • 12. Example of an Applet
    • import javax.swing.*;
    • import java.awt.*;
    • import java.applet.*;
    • /*
    • <applet code=“ImageEx” height=100 width=100>
    • </applet>
    • */
    • public class ImageEx extends Applet
    • {
    • public void paint( Graphics g )
    • {
    • Image img = getImage( getCodeBase( ), “ Lion.jpg&quot; );
    • g.drawImage( img, 0,0, this );
    • }
    • }
    • javac
    • appletviewer
  • 13. Output of a programme
    • Created By :
    • Prashant Marvania
  • 15. Packages
    • A package is a grouping of related types providing access protection and name space management.
    • Types are special kinds of classes and interfaces.
  • 16.
    • You should bundle these classes and the interface in package for several reasons.
    • 1.You and other programmers can easily determine that these types are related.
    • 2.You and other programmers where to find types that can provide graphics-related functions.
    • 3.The name of your won’t conflict with the type names in other packages.
    • 4.You can allow types within the package to have unrestricted access to one another yet still restrict access for types outside the package.
  • 17. Creating a Package
    • To create package, you choose a name for the package and put a package statement with that name the top of every source file that contains the types that you want to include in the package.
  • 18. Naming a Package
    • With programmers worldwide writing classes and interfaces using the java programming language, it is likely that many programmers will use the same name for different types.
  • 19. Naming Conventions
    • Package names are written in all lowercase to avoid conflict the names of classes or interfaces.
    • Companies use their reversed internet domain name to begin their package names.
    • Package in the java language itself begin with java or javax.
  • 20. Using package members
    • To use a public package member from outside its package. you must do one :
    • 1.Refer to the member by its fully qualified name.
    • 2.Import the package member.
    • 3.Import the member’s entire package.
  • 21. Refer to package
    • Graphics. Rectangle
    • You could use this name to create an instance of graphics. Rectangle
    • Graphics. Rectangle myrect=new Graphics. Rectangle ();
  • 22. Import a package member
    • To import a specific member into the current file, put an import statement at the beginning of the file before any type definitions but after the package statement, if there is one.
    • Import graphics. Rectangle;
  • 23. Import entire package
    • To import all the types contained in a particular package, use the import statement with asterisk(*) wildcard character.
    • Import graphics.*;
  • 24. Managing source and class files
    • Many implementations of the java platform rely on hierarchical file systems to manage source and class files, although the java language specification does not require this.
  • 25.
    • The qualified name of the package member and the path name to the file are parallel, assuming the Microsoft windows file name separator backslash.
    • Class name graphics. Rectangle
    • Pathname to file graphicsRectangle. java
  • 26.
    • Each component of the package name corresponds to a subdirectory.
    • It would be contained in a series of subdirectories like this:
    • …
  • 27.
    • A class path may include several paths, separated by a semicolon (windows) or colon (UNIX).
    • By default the compiler and the jvm search the current directory and the jar file containing the java platform classes so that these directories are automatically in your class path.
  • 28.