From 6e6134b43e9b9f39ad46978572168451c30f87d6 Mon Sep 17 00:00:00 2001 From: Jairo Grateron Date: Tue, 25 Jun 2024 13:07:14 -0400 Subject: [PATCH 1/2] add border DH parameters --- .../main/java/org/kse/gui/dialogs/DViewDHParameters.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java b/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java index 2b5fa93b1..24b089102 100644 --- a/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java +++ b/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java @@ -38,6 +38,7 @@ import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; import javax.swing.SwingUtilities; import javax.swing.filechooser.FileNameExtensionFilter; @@ -108,6 +109,9 @@ private void initComponents(byte[] dhParams) throws CryptoException { // keep uneditable color same as editable jtAreaPem.putClientProperty("JTextArea.infoBackground", Boolean.TRUE); + var jspAreaPem = PlatformUtil.createScrollPane(jtAreaPem, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, + ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jbExport = new JButton(res.getString("DViewDHParameters.jbExport.export.text")); jbExport.setToolTipText(res.getString("DViewDHParameters.jbExport.export.tooltip")); PlatformUtil.setMnemonic(jbExport, res.getString("DViewDHParameters.jbExport.mnemonic").charAt(0)); @@ -120,7 +124,7 @@ private void initComponents(byte[] dhParams) throws CryptoException { Container pane = getContentPane(); pane.setLayout(new MigLayout("insets dialog")); - pane.add(jtAreaPem, "span"); + pane.add(jspAreaPem, "span"); pane.add(jbCopy, "tag Copy"); pane.add(jbExport, "tag Export"); pane.add(jbOK, "tag Ok"); From 91877aa80ed952202a63756f338d96db0b413e5d Mon Sep 17 00:00:00 2001 From: Jairo Grateron Date: Tue, 25 Jun 2024 13:11:06 -0400 Subject: [PATCH 2/2] fix variable --- .../main/java/org/kse/gui/dialogs/DViewDHParameters.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java b/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java index 24b089102..840d0a16d 100644 --- a/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java +++ b/kse/src/main/java/org/kse/gui/dialogs/DViewDHParameters.java @@ -37,6 +37,7 @@ import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; +import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.ScrollPaneConstants; import javax.swing.SwingUtilities; @@ -71,6 +72,7 @@ public class DViewDHParameters extends JEscDialog { private static ResourceBundle res = ResourceBundle.getBundle("org/kse/gui/dialogs/resources"); private JTextArea jtAreaPem; + private JScrollPane jspAreaPem; private JButton jbExport; private JButton jbOK; private JButton jbCopy; @@ -107,9 +109,9 @@ private void initComponents(byte[] dhParams) throws CryptoException { jtAreaPem.setEditable(false); jtAreaPem.setFont(new Font(Font.MONOSPACED, Font.PLAIN, LnfUtil.getDefaultFontSize())); // keep uneditable color same as editable - jtAreaPem.putClientProperty("JTextArea.infoBackground", Boolean.TRUE); + jtAreaPem.putClientProperty("JTextArea.infoBackground", Boolean.TRUE); - var jspAreaPem = PlatformUtil.createScrollPane(jtAreaPem, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, + jspAreaPem = PlatformUtil.createScrollPane(jtAreaPem, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jbExport = new JButton(res.getString("DViewDHParameters.jbExport.export.text"));