From 2ef5477f6d53a9c5273e66ec652a5266b1088eff Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 30 Aug 2023 20:42:07 -0400 Subject: [PATCH] change ok cancel order --- .../ctoptions/ctcloud/Bundle.properties | 2 +- .../ctcloud/Bundle.properties-MERGED | 2 +- .../ctoptions/ctcloud/CTLicenseDialog.form | 99 +++++++++++-------- .../ctoptions/ctcloud/CTLicenseDialog.java | 54 ++++++---- 4 files changed, 95 insertions(+), 62 deletions(-) diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties index 44e71a4513..8ad7ccebe9 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties @@ -6,7 +6,7 @@ CTLicenseDialog.title=Add a License... CTLicenseDialog.licenseNumberLabel.text=License Number: CTLicenseDialog.licenseNumberTextField.text= CTLicenseDialog.cancelButton.text=Cancel -CTLicenseDialog.okButton.text=Ok +CTLicenseDialog.okButton.text=OK CTLicenseDialog.warningLabel.text= CTMalwareScannerOptionsPanel.hashLookupsRemainingLabel.text= CTMalwareScannerOptionsPanel.countersResetLabel.text= diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED index d9876a8ed7..8b72302f47 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/Bundle.properties-MERGED @@ -6,7 +6,7 @@ CTLicenseDialog.title=Add a License... CTLicenseDialog.licenseNumberLabel.text=License Number: CTLicenseDialog.licenseNumberTextField.text= CTLicenseDialog.cancelButton.text=Cancel -CTLicenseDialog.okButton.text=Ok +CTLicenseDialog.okButton.text=OK CTLicenseDialog.warningLabel.text= CTLicenseDialog_verifyInput_licenseNumberError=Please enter a license number CTMalwareScannerOptionsPanel.hashLookupsRemainingLabel.text= diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.form b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.form index 2ea57d43a8..cfa4c7e818 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.form +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.form @@ -23,7 +23,7 @@ - + @@ -44,6 +44,21 @@ + + + + + + + + + + + + + + + @@ -92,50 +107,50 @@ - - - - - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.java b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.java index 99fc749dd7..4510a34cbe 100644 --- a/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.java +++ b/Core/src/com/basistech/df/cybertriage/autopsy/ctoptions/ctcloud/CTLicenseDialog.java @@ -58,6 +58,11 @@ class CTLicenseDialog extends javax.swing.JDialog { verifyInput(); } }); + + // set ok button as primary button + this.getRootPane().setDefaultButton(okButton); + // request focus for entering license string + this.licenseNumberTextField.requestFocusInWindow(); } private void configureHintText() { @@ -99,11 +104,12 @@ class CTLicenseDialog extends javax.swing.JDialog { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel licenseNumberLabel = new javax.swing.JLabel(); + licenseNumberTextField = new javax.swing.JTextField(); warningLabel = new javax.swing.JLabel(); javax.swing.JPanel buttonPadding = new javax.swing.JPanel(); + javax.swing.JPanel buttonPanel = new javax.swing.JPanel(); okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); - licenseNumberTextField = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.title")); // NOI18N @@ -121,6 +127,16 @@ class CTLicenseDialog extends javax.swing.JDialog { gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(licenseNumberLabel, gridBagConstraints); + licenseNumberTextField.setText(org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.licenseNumberTextField.text")); // NOI18N + licenseNumberTextField.setToolTipText(org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.licenseNumberTextField.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); + getContentPane().add(licenseNumberTextField, gridBagConstraints); + warningLabel.setForeground(java.awt.Color.RED); org.openide.awt.Mnemonics.setLocalizedText(warningLabel, org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.warningLabel.text")); // NOI18N warningLabel.setMaximumSize(new java.awt.Dimension(419, 36)); @@ -151,6 +167,8 @@ class CTLicenseDialog extends javax.swing.JDialog { gridBagConstraints.weightx = 1.0; getContentPane().add(buttonPadding, gridBagConstraints); + buttonPanel.setLayout(new java.awt.GridBagLayout()); + org.openide.awt.Mnemonics.setLocalizedText(okButton, org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.okButton.text")); // NOI18N okButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -158,11 +176,13 @@ class CTLicenseDialog extends javax.swing.JDialog { } }); gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - getContentPane().add(okButton, gridBagConstraints); + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 5); + buttonPanel.add(okButton, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.cancelButton.text")); // NOI18N cancelButton.addActionListener(new java.awt.event.ActionListener() { @@ -172,20 +192,18 @@ class CTLicenseDialog extends javax.swing.JDialog { }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 3; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - getContentPane().add(cancelButton, gridBagConstraints); - - licenseNumberTextField.setText(org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.licenseNumberTextField.text")); // NOI18N - licenseNumberTextField.setToolTipText(org.openide.util.NbBundle.getMessage(CTLicenseDialog.class, "CTLicenseDialog.licenseNumberTextField.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 3; + gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); - getContentPane().add(licenseNumberTextField, gridBagConstraints); + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); + buttonPanel.add(cancelButton, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 3; + gridBagConstraints.gridwidth = 2; + getContentPane().add(buttonPanel, gridBagConstraints); pack(); }// //GEN-END:initComponents