Q:

Converting Java application to an applet confusion

I'm working on creating a Space Invaders type clone and I've got it nearly finished. The problem now is that I would like to have my friend post this to his website so I need to convert it to an applet from an application. I've looked at some examples online and played around a bit with it and tried putting it into a simple webpage made with html but I can't seem to get it to work right. Could someone take a look at my code and kind of walk me through this conversion? I would greatly appreciate any help! I'm posting the application code so anything I might have tried doesn't get mixed up.
public class InvadersMain implements KeyListener{

// GUI, Keyboard, Game Data here
private JFrame frame;
private JPanel playArea;
private JPanel sidePanel;
private JLabel scoreLabel;
private JLabel scoreDisplay;
private JLabel livesLabel;
private JLabel livesDisplay;
private JLabel title1;
private JLabel title2;

private final int playWidth = 500;
private final int playHeight = 500;

public String name = "";

public int baddysDead = 0;
public int playerScore = 0;
public int playerLives = 3;
public int waveNumber = 1;
public int waveScore = 20;

public double baddySpeed = 1 + (waveNumber-1)/5000;
// Game Data
private InvadersShip ship;

public ArrayList<InvadersShot> shots;
public ArrayList<InvadersBaddy> baddys;

private boolean shipDead; // Whether or not the ship has been blown up
private long shipTimeOfDeath; // The time at which the ship blew up

// Keyboard data
private boolean rightHeld = false;
private boolean leftHeld = false;
private boolean firing = false;

// Set up the game and play
public InvadersMain(){

    // set everything up
    configureGUI();
    configureGameData();

    // display window
    frame.setVisible(true);

    // start game
    playGame();
    name = JOptionPane.showInputDialog( null, "GAME OVER \nPlease enter your name");

}

I'm trying to isolate the parts that need to be changed, so if anything further is needed please let me know.
public static void main(String[] args){
    new InvadersMain();

}

A:

Here's possibly a better idea -- rather than try to push a square peg (your program that creates a JFrame) into a round hole (change it into an applet), why not instead use Java Web Start, so the web page can publish the JFrame? I think in the long run, this will make things easier for you.
Please have a look here:

Lesson: Java Web Start
Deploying a Java Web Start Application
Java Web Start tutorial

