Core java tutorial for beginners
A tutorial blog which explains different core concepts related to Java along with programming examples
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Applets. 1 Comment on Applet Class
5
(1)

In this article we will learn about the pre-defined Applet class which is available in java.lang package and the methods available in it.

 

The Applet class provides the support for creation and execution of applets. It allows us to start and stop the execution of an applet. Applet class extends the Panel class which extends Container class and which in turn extends the Component class. So applet supports all window-based activities.

 

Methods in Applet Class

 

Below are some of the methods available in the class Applet:

  • init() – This method is called when the execution of the applet begins. It is the entry point for all applets.
  • start() – This method is automatically executed after the init() method completes its execution or whenever the execution of an applet is resumed.
  • stop() – This method executes whenever the execution of the applet is suspended.
  • destroy() – This method is called when the webpage containing the applet is closed.
  • getCodeBase() – Returns the URL associated with the applet.
  • getDocumentBase() – Returns the URL of the HTML document that invokes the applet.
  • getParameter(String paramName) – Returns the value associated with the paramName. Returns null if there is no value.
  • isActive() – Returns true if the applet is started or false if the applet is stopped.
  • resize(int width, int height) – Resizes the applet based on the given width and height.
  • showStatus(String str) – Displays the string str in the status bar of the browser or applet.

 


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

1 Comment

You can follow any responses to this entry through the RSS 2.0 feed.

very easy to learn

Leave a Reply

Your email address will not be published. Required fields are marked *