They are using HTML program and using applet viewer tool.
![using applet viewer command line using applet viewer command line](https://3.bp.blogspot.com/--d4JQdtvKxk/UtaN6hEWhSI/AAAAAAAAFlI/GqlMynLf4PY/s1600/running-applet.jpg)
(Graphics => public void drawString (String, int row position, int column position))Īn object of Graphics class will be created automatically after loading the applet into the browser. Paint method is internally calling the method called drawString whose prototype is given below. This method is used for displaying the data on to the browser. This is the method which will be called by the browser after completion of start method. In this method we write same block of statements which will releases the resources permanently which are obtained in init method.Īnother method which is not a life cycle method is public void paint (). Public void destroy (): This is the method which will be called by the browser when we close the window button or when we terminate the applet application.In this method we write the block of statements which will temporarily releases the resources which are obtained in init method. Public void stop (): This id the method which is called by the browser when we minimize the window.In this method we write the block of statement which provides business logic. Public void start (): After calling the init method, the next method which is from second request to sub-sequent requests the start method only will be called i.e., short method will be called each and every time.In this method we write some block of statements which will perform one time operations, such as, obtaining the resources like opening the files, obtaining the database connection, initializing the parameters, etc. Public void init (): This is the method which is called by the browser only one time after loading the applet.They are public void init (), public void start (), public void stop () and public void destroy (). Life cycle methods are also called as loop back methods. Since applets are running in the browser, the class Applet contains the life cycle methods. This package contains only one class Applet whose fully qualified name is.
![using applet viewer command line using applet viewer command line](https://miro.medium.com/freeze/max/393/0*q61J-A9p_PFY4Gat.gif)
In order to deal with applets we must import a package called java.applet.*. "An applet is a JAVA program which runs in the context of browser or World Wide Web".
![using applet viewer command line using applet viewer command line](http://webjellee.weebly.com/uploads/9/0/4/4/9044014/810955_orig.jpg)
In JAVA, SUN micro initially has developed a concept called applets which runs in the context of browser. Any technology which runs in the browser will have 'n' number of life cycle methods and it does not contain main methods and statements. Every standalone application runs from command prompt and it contains main method along with statements.Ī distributed application is one which runs in the context of browser or World Wide Web and it can be accessed across the globe. They are standalone applications and distributed applications.Ī standalone application is one which runs in the context of local disk and whose result is not sharable.
![using applet viewer command line using applet viewer command line](https://command-not-found.com/og/1200x628/cmd/jvncviewer.png)
In JAVA we write two types of programs or applications.