public Connect4MainWindow(Applet applet, int x, int y, int width, int height) throws IOException { super( applet, new Connect4Game( new GameContext( PLAYERS, new ObjectPool(Connect4Board.class), new Connect4MoveFactory(), true), new Settings( AppletConsts.SEARCH_LEVELS, AppletConsts.SEARCH_THRESHOLDS, AppletConsts.PLAYERS, 0, 3)), x, y, width, height); loadImages(); loadAudioClips(); // new game option window OptionWindow newGameOptionWindow = new OptionWindow( this, AppletConsts.LABEL_CONFIRM_NEW, AppletConsts.LABEL_OPTIONS_CONFIRM_NEW, AppletConsts.COLOUR_WINDOW_FOREGROUND, AppletConsts.COLOUR_WINDOW_BACKGROUND, AppletConsts.COLOUR_WINDOW_HI_FOREGROUND, AppletConsts.DEFAULT_FONT, AppletConsts.SELECT_ITEM_SPACING) { private static final long serialVersionUID = 558060748211269739L; public void processWidgetEvent(WidgetEvent event) { switch (event.getID()) { case Event.NEW_GAME: open(); break; } } protected void selectAction(MouseEvent e) { if (selection == 0) { playAudioClip(ACTION_AUDIO); startGame(); } } }; newGameOptionWindow.close(); add(newGameOptionWindow); // help text window TextWindow helpTextWindow = new TextWindow( this, getWidth() - (2 * AppletConsts.TEXT_WINDOW_INSET), getHeight() - (2 * AppletConsts.TEXT_WINDOW_INSET), AppletConsts.HELP_TEXT, AppletConsts.COLOUR_WINDOW_FOREGROUND, AppletConsts.COLOUR_WINDOW_BACKGROUND, AppletConsts.COLOUR_WINDOW_HI_FOREGROUND, AppletConsts.COLOUR_SCROLLBAR_HI, AppletConsts.TEXT_WINDOW_FONT, AppletConsts.TEXT_WINDOW_SPACING) { private static final long serialVersionUID = -4660922912811065972L; @Override public void processWidgetEvent(WidgetEvent event) { switch (event.getID()) { case Event.OPEN_HELP: open(); break; case Event.CLOSE_HELP: close(); break; } } }; helpTextWindow.close(); add(helpTextWindow); addIcons(); addWidgets(); startGame(); }