// 140509 TA public void goToPreviousGamePanel() { this.getCardLayout().show(this.getcontentPane(), "Main"); this.getCurrentPanel().hide(); currentPanel = gamePanel.getPreviousPanel(); nbrButtons = gamePanel.nbrGamesOnPanel(gamePanel.getCurrentPanelId()); System.out.println(nbrButtons + " " + gamePanel.getCurrentPanelId()); this.currentPanel.show(); }
// 140509 TA public void goToNextGamePanel() { this.getCardLayout().show(this.getcontentPane(), "Main"); this.getCurrentPanel().hide(); currentPanel = gamePanel.getNextPanel(); nbrButtons = gamePanel.nbrGamesOnPanel(gamePanel.getCurrentPanelId()); this.currentPanel.show(); }
// 140509 TA public String gameButtonPressed(int selectedButton) { String[] list = gamePanel.getListOfGames(); String file = ""; // Calculate which button was actually pressed, based on which panel is // shown and which button (0-x) is selected. int gameNumber = gamePanel.getCurrentPanelId() * gamePanel.getNbrGamesPerPage() + selectedButton; file = list[gameNumber]; return file; }