Made the "Continue" buttont he default button of the new setting dialog box

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10051 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 2f886846c8
commit 3f815a0c70
  1. 12
      engine/src/desktop/com/jme3/app/SettingsDialog.java

@ -238,10 +238,10 @@ public final class SettingsDialog extends JDialog {
*/ */
public void showDialog() { public void showDialog() {
setLocationRelativeTo(null); setLocationRelativeTo(null);
setVisible(true); setVisible(true);
toFront(); toFront();
} }
/** /**
* <code>init</code> creates the components to use the dialog. * <code>init</code> creates the components to use the dialog.
*/ */
@ -272,7 +272,7 @@ public final class SettingsDialog extends JDialog {
setTitle(MessageFormat.format(resourceBundle.getString("frame.title"), source.getTitle())); setTitle(MessageFormat.format(resourceBundle.getString("frame.title"), source.getTitle()));
// The buttons... // The buttons...
JButton ok = new JButton(resourceBundle.getString("button.ok")); JButton ok = new JButton(resourceBundle.getString("button.ok"));
JButton cancel = new JButton(resourceBundle.getString("button.cancel")); JButton cancel = new JButton(resourceBundle.getString("button.cancel"));
icon = new JLabel(imageFile != null ? new ImageIcon(imageFile) : null); icon = new JLabel(imageFile != null ? new ImageIcon(imageFile) : null);
@ -403,7 +403,7 @@ public final class SettingsDialog extends JDialog {
gbc.gridwidth = 2; gbc.gridwidth = 2;
gbc.gridy = 4; gbc.gridy = 4;
gbc.anchor = GridBagConstraints.EAST; gbc.anchor = GridBagConstraints.EAST;
mainPanel.add(ok, gbc); mainPanel.add(ok, gbc);
gbc = new GridBagConstraints(); gbc = new GridBagConstraints();
gbc.insets = new Insets(4, 16, 4, 4); gbc.insets = new Insets(4, 16, 4, 4);
gbc.gridx = 2; gbc.gridx = 2;
@ -422,7 +422,7 @@ public final class SettingsDialog extends JDialog {
pack(); pack();
mainPanel.getRootPane().setDefaultButton(ok);
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
@ -440,7 +440,7 @@ public final class SettingsDialog extends JDialog {
updateAntialiasChoices(); updateAntialiasChoices();
colorDepthCombo.setSelectedItem(source.getBitsPerPixel() + " bpp"); colorDepthCombo.setSelectedItem(source.getBitsPerPixel() + " bpp");
} }
}); });
} }

Loading…
Cancel
Save