Opening the new tab after starting a game

This commit is contained in:
Kai S. K. Engelbart 2019-09-01 18:57:31 +02:00
parent c712e066fe
commit 875cd22521

View File

@ -69,13 +69,14 @@ public class MainWindow {
public GamePane getSelectedGamePane() { return (GamePane) tabbedPane.getSelectedComponent(); }
/**
* Creates a new {@link GamePane} and adds it to the tabbed pane.
* Creates a new {@link GamePane}, adds it to the tabbed pane and opens it.
*
* @return The new {@link GamePane}
*/
public GamePane addGamePane() {
GamePane gamePane = new GamePane();
tabbedPane.add("Game " + (tabbedPane.getComponentCount() + 1), gamePane);
tabbedPane.setSelectedIndex(tabbedPane.getComponentCount() - 1);
return gamePane;
}
}