Skip to content

Commit 5915352

Browse files
committed
Merge pull request processing#3232 from Akarshit/enhan-prefWindoe
Enhan pref windoe
2 parents 9e3fb32 + 560ec77 commit 5915352

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

app/src/processing/app/PreferencesFrame.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public class PreferencesFrame {
7777
String[] monoFontFamilies;
7878
JComboBox<String> fontSelectionBox;
7979

80+
JButton okButton;
81+
8082
/** Base object so that updates can be applied to the list of editors. */
8183
Base base;
8284

@@ -554,7 +556,7 @@ public void mouseExited(MouseEvent e) {
554556

555557
// [ OK ] [ Cancel ] maybe these should be next to the message?
556558

557-
JButton okButton = new JButton(Preferences.PROMPT_OK);
559+
okButton = new JButton(Preferences.PROMPT_OK);
558560
okButton.addActionListener(new ActionListener() {
559561
public void actionPerformed(ActionEvent e) {
560562
applyFrame();
@@ -710,6 +712,7 @@ public void actionPerformed(ActionEvent actionEvent) {
710712

711713
Toolkit.registerWindowCloseKeys(dialog.getRootPane(), disposer);
712714
Toolkit.setIcon(dialog);
715+
dialog.setResizable(false);
713716
dialog.pack();
714717
dialog.setLocationRelativeTo(null);
715718

@@ -912,6 +915,15 @@ public void run() {
912915
if (autoAssociateBox != null) {
913916
autoAssociateBox.setSelected(Preferences.getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$
914917
}
918+
// The OK Button has to be set as the default button every time the
919+
// PrefWindow is to be displayed
920+
dialog.getRootPane().setDefaultButton(okButton);
921+
922+
// The pack is called again here second time to fix layout bugs
923+
// the bugs are not due to groupLayout but due to HTML rendering of components
924+
// more info can be found here -> https://netbeans.org/bugzilla/show_bug.cgi?id=79967
925+
dialog.pack();
926+
915927
dialog.setVisible(true);
916928
}
917929

0 commit comments

Comments
 (0)