@Override public void windowClosing(WindowEvent e) { for (SettingsTab tab : this.settingsTabs) { tab.doDelayedSettingChange(); } this.dispose(); }
private void placeComponents() { this.setLayout(new GridBagLayout()); JTabbedPane tabPane = new JTabbedPane(); for (SettingsTab tab : this.settingsTabs) { tabPane.add(tab.toString(), tab); } JPanel controls = new JPanel(); controls.add(this.actionOK); controls.add(this.reset); this.add(tabPane, GBC.grid(0, 0)); this.add(controls, GBC.grid(0, 1).insets(6, 0, 4, 0)); }
@Override public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source.equals(this.actionOK)) { for (SettingsTab tab : this.settingsTabs) { tab.doDelayedSettingChange(); } this.dispose(); } else if (source.equals(this.reset)) { int option = JOptionPane.showConfirmDialog(this, "" + Language.WARN_RESET_SETTINGS); if (option == JOptionPane.YES_OPTION) { Settings.reset(); this.dispose(); } } }