Reset settings panel selected tab
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@405 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
182d3b499b
commit
9c553786f2
2 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -350,6 +350,10 @@ public class View extends JFrame implements IView {
|
|||
|
||||
@Override
|
||||
public void showSettingsPanel(boolean show) {
|
||||
if (show) {
|
||||
settingsPanel.resetTabbedPane();
|
||||
}
|
||||
|
||||
settingsPanel.setVisible(show);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue