What is the simplest way to convert a Swing Application into an Applet?

Dror Matalon

Do the following:

Your application has the following code:

public static void main(String[] args)
    MyApp foo = new MyApp();

where MyApp is your main class.

  1. Change the class definition so that it "extends JApplet" . change public class Myapp to public Myapp extends JApplet.
  2. Change the constructor for the class to a method called init().
  3. create a method called start().
  4. Create a method called stop().

That's the basic stuff. Note that your application might still have problems because of security issues. Applets are not allowed to read/write files locally and do networks connections where applications can.