Opening the new tab after starting a game
This commit is contained in:
parent
5ecbeb7677
commit
15fc153dac
@ -69,13 +69,14 @@ public class MainWindow {
|
|||||||
public GamePane getSelectedGamePane() { return (GamePane) tabbedPane.getSelectedComponent(); }
|
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}
|
* @return The new {@link GamePane}
|
||||||
*/
|
*/
|
||||||
public GamePane addGamePane() {
|
public GamePane addGamePane() {
|
||||||
GamePane gamePane = new GamePane();
|
GamePane gamePane = new GamePane();
|
||||||
tabbedPane.add("Game " + (tabbedPane.getComponentCount() + 1), gamePane);
|
tabbedPane.add("Game " + (tabbedPane.getComponentCount() + 1), gamePane);
|
||||||
|
tabbedPane.setSelectedIndex(tabbedPane.getComponentCount() - 1);
|
||||||
return gamePane;
|
return gamePane;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user