Opening the new tab after starting a game
This commit is contained in:
parent
c712e066fe
commit
875cd22521
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user