From 0300d720b6d67d7bfe67e654ec1b3a3d7e10a96b Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Thu, 30 Apr 2015 18:14:43 +0530 Subject: [PATCH 1/3] Made the PrefWindow non-resizable & fixed the layout of JComboBoxs by calling pack() twice --- app/src/processing/app/PreferencesFrame.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/processing/app/PreferencesFrame.java b/app/src/processing/app/PreferencesFrame.java index 57596140f..10e3a82cf 100644 --- a/app/src/processing/app/PreferencesFrame.java +++ b/app/src/processing/app/PreferencesFrame.java @@ -710,6 +710,7 @@ public class PreferencesFrame { Toolkit.registerWindowCloseKeys(dialog.getRootPane(), disposer); Toolkit.setIcon(dialog); + dialog.setResizable(false); dialog.pack(); dialog.setLocationRelativeTo(null); @@ -912,6 +913,11 @@ public class PreferencesFrame { if (autoAssociateBox != null) { autoAssociateBox.setSelected(Preferences.getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$ } + // The pack is called again here second time to fix layout bugs + // the bugs are not due to groupLayout but due to HTML rendering of components + // more info can be found here -> https://netbeans.org/bugzilla/show_bug.cgi?id=79967 + dialog.pack(); + dialog.setVisible(true); } From 7c1abb7b11e19ea2e9408d58a0c9c17788c7497b Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Thu, 30 Apr 2015 18:15:22 +0530 Subject: [PATCH 2/3] Removed extra space --- app/src/processing/app/PreferencesFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/PreferencesFrame.java b/app/src/processing/app/PreferencesFrame.java index 10e3a82cf..e5d90e102 100644 --- a/app/src/processing/app/PreferencesFrame.java +++ b/app/src/processing/app/PreferencesFrame.java @@ -917,7 +917,7 @@ public class PreferencesFrame { // the bugs are not due to groupLayout but due to HTML rendering of components // more info can be found here -> https://netbeans.org/bugzilla/show_bug.cgi?id=79967 dialog.pack(); - + dialog.setVisible(true); } From 2bd5f7a8e7bbe2e0057e4fe4e136ed75dfb063e2 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Thu, 30 Apr 2015 18:42:51 +0530 Subject: [PATCH 3/3] Made the okButton as the default button everytime so that it gets highlighted --- app/src/processing/app/PreferencesFrame.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/PreferencesFrame.java b/app/src/processing/app/PreferencesFrame.java index e5d90e102..b3121da55 100644 --- a/app/src/processing/app/PreferencesFrame.java +++ b/app/src/processing/app/PreferencesFrame.java @@ -77,6 +77,8 @@ public class PreferencesFrame { String[] monoFontFamilies; JComboBox fontSelectionBox; + JButton okButton; + /** Base object so that updates can be applied to the list of editors. */ Base base; @@ -554,7 +556,7 @@ public class PreferencesFrame { // [ OK ] [ Cancel ] maybe these should be next to the message? - JButton okButton = new JButton(Preferences.PROMPT_OK); + okButton = new JButton(Preferences.PROMPT_OK); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { applyFrame(); @@ -913,6 +915,10 @@ public class PreferencesFrame { if (autoAssociateBox != null) { autoAssociateBox.setSelected(Preferences.getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$ } + // The OK Button has to be set as the default button every time the + // PrefWindow is to be displayed + dialog.getRootPane().setDefaultButton(okButton); + // The pack is called again here second time to fix layout bugs // the bugs are not due to groupLayout but due to HTML rendering of components // more info can be found here -> https://netbeans.org/bugzilla/show_bug.cgi?id=79967