How to convert applet to application and vice versa
Steps to convert applet to an application
-
Change
int()methods name to the construction. -
Replace “extends Applet” with “extends frame” for the class.
-
Create a new
main()method. -
Relate “import” statement for class applet.
-
Add window listener’s method to handle window events.
Steps to convert an application to applet
-
Add the “import java.applet” statement.
-
Replace, “extends frame” with “applet”.
-
Replace the construction with an applet.
-
Click the layout for the applet. The default layout is a flow layout and is the border layout for the frame.
-
Delete set
XYZ()methods, likeset size(), etc. -
Delete the
main()method. -
Add on HTML file.