How To Covert a Java Application to an Applet Program
Imagine that you have a Java program written as an application with the target
class called Target. We now want to convert this application to an applet.
- In Target.java add import java.applet.*; to the top of the file.
- Make Target a subclass of Applet by adding extends Applet to the Target class
declaration.
- Eliminate the main method.
- Replace the constructor for Target with the method public void init().