public Client(String playername) { this(new Frame("MegaMek Client"), playername);  Settings.load();  if(Settings.windowSizeHeight != 0) { frame.setLocation(Settings.windowPosX, Settings.windowPosY); frame.setSize(Settings.windowSizeWidth, Settings.windowSizeHeight); } else { frame.setSize(800, 600); }  frame.setBackground(SystemColor.menu); frame.setForeground(SystemColor.menuText);  frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false);  Settings.windowPosX = frame.getLocation().x; Settings.windowPosY = frame.getLocation().y; Settings.windowSizeWidth = frame.getSize().width; Settings.windowSizeHeight = frame.getSize().height;   Settings.save();  die(); } });  standalone = false;  frame.setVisible(true);
public Client(String name, String host, int port) {  this(name);   if(!connect(host, port)) { String error = "Error: could not connect to server at " + host + ":" + port + "."; new AlertDialog(frame, "Host a Game", error).show(); frame.setVisible(false); die(); }   retrieveServerInfo();
    public Client(String playername) {        this(new Frame("MegaMek Client"), playername);        Settings.load();                if(Settings.windowSizeHeight != 0) {            frame.setLocation(Settings.windowPosX, Settings.windowPosY);            frame.setSize(Settings.windowSizeWidth, Settings.windowSizeHeight);        } else {            frame.setSize(800, 600);        }                frame.setBackground(SystemColor.menu);        frame.setForeground(SystemColor.menuText);                frame.addWindowListener(new WindowAdapter() {      public void windowClosing(WindowEvent e) { setVisible(false);                // feed last window position to settings                Settings.windowPosX = frame.getLocation().x;                Settings.windowPosY = frame.getLocation().y;                Settings.windowSizeWidth = frame.getSize().width;                Settings.windowSizeHeight = frame.getSize().height;                // save settings                Settings.save();                                die();            }  });                standalone = false;                frame.setVisible(true);    }