summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-10 20:20:05 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-10 20:20:05 +0200
commit9c553786f2e0e395149a5ef5e27d24d7d944fe3e (patch)
treec46ce721d6e25ed456155a5399f8dcea920d80f5 /src/jrummikub/view/impl
parent182d3b499b306f660d3bf69ddd83d60f47b9e223 (diff)
downloadJRummikub-9c553786f2e0e395149a5ef5e27d24d7d944fe3e.tar
JRummikub-9c553786f2e0e395149a5ef5e27d24d7d944fe3e.zip
Reset settings panel selected tab
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@405 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view/impl')
-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);
}