summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java7
-rw-r--r--src/jrummikub/view/impl/View.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index 740cfc8..d7d9069 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -60,6 +60,7 @@ import jrummikub.view.ISettingsPanel;
@SuppressWarnings("serial")
class SettingsPanel extends JPanel implements ISettingsPanel {
+ private JTabbedPane tabbedPane;
private JPanel playerSetupPanel;
private JPanel playerSettingsViewport;
private JPanel optionsPanel;
@@ -422,7 +423,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
SettingsPanel() {
setLayout(new GridBagLayout());
- final JTabbedPane tabbedPane = new JTabbedPane();
+ tabbedPane = new JTabbedPane();
createPlayerSetupPanel();
tabbedPane.addTab("Spieler", playerSetupPanel);
@@ -461,6 +462,10 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
10, 10, 10, 10)));
}
+ void resetTabbedPane() {
+ tabbedPane.setSelectedIndex(0);
+ }
+
private JButton addButton(String title, final Event event,
GridBagConstraints c) {
JButton button = new JButton(title);
diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java
index 8ef8e50..99e8924 100644
--- a/src/jrummikub/view/impl/View.java
+++ b/src/jrummikub/view/impl/View.java
@@ -350,6 +350,10 @@ public class View extends JFrame implements IView {
@Override
public void showSettingsPanel(boolean show) {
+ if (show) {
+ settingsPanel.resetTabbedPane();
+ }
+
settingsPanel.setVisible(show);
}