Hey guys.
I’m new to the boards, and relatively new to Java compared to most 
I wrote a game, in a JFrame, as an application. Now, to change it to an applet, it works fine, running it in a browser. (Haven’t tried hosting it yet). The only problem is closing the window.
Here is the code for my windowListener part:
JFrame ventana = new JFrame("RA Invaders");
JPanel panel = (JPanel) ventana.getContentPane();
setBounds(0, 0, Stage.WIDTH, Stage.HEIGHT);
panel.setPreferredSize(new Dimension(Stage.WIDTH, Stage.HEIGHT));
panel.setLayout(null);
panel.add(this);
ventana.setBounds(0, 0, Stage.WIDTH, Stage.HEIGHT);
ventana.setVisible(true);
ventana.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
ventana.setResizable(false);
createBufferStrategy(2);
strategy = getBufferStrategy();
requestFocus();
So, I have to put somewhere the dispose() and setVisible(false) somewhere. Or do I have to add a windowListener to the class that extends JApplet? The code above is in another class called FrontEnd, which just has its main/init() method called from a class that extends JApplet. When I ran it, I ended up having the small applet window pop up, then the JFrame window pop up. Realistically, I want the JFrame in the original webpage, but I just want the window to close for now 
Any help at all would be appreciated.
Jay