import java.applet.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;

/** Application class defines an application which
 * consists of BattleShip applet in its own frame
 */
public class Application{
 
  /** Main method for application */
  public static void main(String[] Args){
    
    Frame f = new Frame("BattleShip Game");
    BattleShip b = new BattleShip();

    // Initialises the applet
    b.init();
    
    // Adds applet to frame
    f.add("Center", b);
    f.pack();
    
    // Nameless class, which defines and registers a listener
    // to close the frame.
    f.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
	System.exit(0);
      }
    });

    // Shows the frame
    f.setVisible(true);

  }
}

