From 08795afd60ba43fe9c5f34e13bbc69de7c94a5d1 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 3 Sep 2024 16:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=A7=A3=E5=AF=86=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=A1=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/DecodeDialog.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java index f76ed4711b..88b126e07b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java @@ -1,11 +1,15 @@ package com.fr.design.mainframe; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JDialog; +import javax.swing.JPanel; +import com.fine.theme.utils.FineUIStyle; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.DesignerEnvManager; @@ -19,6 +23,9 @@ import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + public class DecodeDialog { private UITextField jt; @@ -32,22 +39,18 @@ public class DecodeDialog { this.file = file; jd = new JDialog(); - jd.setLayout(null); + jd.setLayout(new BorderLayout()); UILabel newNameLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ECP_Input_Pwd")); - newNameLable.setBounds(20, 10, 130, 30); jt = new UITextField(StringUtils.EMPTY); jt.selectAll(); - jt.setBounds(130, 15, 150, 20); - jd.add(newNameLable); - jd.add(jt); + jd.add(row(20, cell(newNameLable), cell(jt)).getComponent(), BorderLayout.NORTH); hintsLabel = new UILabel(); - hintsLabel.setBounds(20, 50, 250, 30); hintsLabel.setForeground(Color.RED); hintsLabel.setVisible(false); confirmButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm")); - confirmButton.setBounds(180, 90, 60, 25); + FineUIStyle.setStyle(confirmButton, FineUIStyle.PLAIN_BUTTON); confirmButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String key = jt.getText(); @@ -64,16 +67,17 @@ public class DecodeDialog { }); UIButton cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); - cancelButton.setBounds(250, 90, 60, 25); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jd.dispose(); } }); - jd.add(cancelButton); - jd.add(confirmButton); - jd.add(hintsLabel); + JPanel buttonPane = new JPanel(new BorderLayout()); + buttonPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + buttonPane.add(row(8, cell(confirmButton), cell(cancelButton)).getComponent(), BorderLayout.EAST); + jd.add(buttonPane, BorderLayout.SOUTH); + jd.add(hintsLabel, BorderLayout.CENTER); jd.setSize(340, 180); jd.setModal(true); jd.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ECP_Decode"));