To quickly convert a Java application to a Java applet, follow these simple steps below:

  1. Change:
    public class HelloWorld {
    to:
    public class HelloWorld extends JApplet{
  2. Change:
    public static void main(String[] args) {
    to:
    public void init() {
  3. Remove:
    JFrame frame;
    and change all references to the frame in the class to:
    this
    and all references in subclasses to:
    null
  4. Move all your images into a subfolder called "images".
  5. Add this global variable:
    private final static String imagePath = "images//"
  6. Create a method to load ImageIcons as resources:
        private ImageIcon LoadImageIcon(String imgName){
        	
        	URL myResource = this.getClass().getResource(imgName);
        	
        	return new ImageIcon(myResource);
        }
    and change all instances of:
    new ImageIcon("example.jpg")
    to:
    LoadImageIcon(imagePath + "example.jpg")
  7. Build a jar archive of your compiled class files.
  8. Create a HTML file like this one:
    <html>
    <body>
    <applet 
    	code="HelloWorld.class" 
    	archive="HelloWorld.jar" 
    	height="100" 
    	width="100">
    </body>
    </html>

And then, you are all set!