From 69b40096cb0ae965f2a3e92672b880edfe7d04d2 Mon Sep 17 00:00:00 2001
From: 826220679@qq.com <826220679@qq.com>
Date: 星期六, 27 十二月 2025 21:14:09 +0800
Subject: [PATCH] 优化了登录页面

---
 src/denglu/RegistrationFrame.java |   52 +++++++---------------------------------------------
 1 files changed, 7 insertions(+), 45 deletions(-)

diff --git a/src/denglu/RegistrationFrame.java b/src/denglu/RegistrationFrame.java
index 919877d..717868e 100644
--- a/src/denglu/RegistrationFrame.java
+++ b/src/denglu/RegistrationFrame.java
@@ -3,6 +3,7 @@
 import ui.UIConfig;
 import login.EmailCodeSender;
 import login.UserRegister;
+import publicway.buttonset;
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
@@ -264,31 +265,12 @@
         ));
         verificationCodeField.setAlignmentX(Component.LEFT_ALIGNMENT);
         
-        // 鍙戦�侀獙璇佺爜鎸夐挳 - 鍗曠嫭涓�琛�
-        sendCodeButton = new JButton("鍙戦�侀獙璇佺爜");
-        sendCodeButton.setBackground(THEME_COLOR);
-        sendCodeButton.setForeground(Color.WHITE);
+        // 鍙戦�侀獙璇佺爜鎸夐挳 - 浣跨敤buttonset鍒涘缓
+        sendCodeButton = buttonset.createStyledButton("鍙戦�侀獙璇佺爜", THEME_COLOR);
         sendCodeButton.setFont(new Font("PingFang SC", Font.BOLD, 14));
         sendCodeButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, 35));
-        sendCodeButton.setBorderPainted(false);
-        sendCodeButton.setFocusPainted(false);
-        sendCodeButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
         sendCodeButton.setAlignmentX(Component.LEFT_ALIGNMENT);
         
-        // 楠岃瘉鐮佹寜閽偓鍋滄晥鏋�
-        sendCodeButton.addMouseListener(new MouseAdapter() {
-            public void mouseEntered(MouseEvent e) {
-                if (sendCodeButton.isEnabled()) {
-                    sendCodeButton.setBackground(THEME_HOVER_COLOR);
-                }
-            }
-            public void mouseExited(MouseEvent e) {
-                if (sendCodeButton.isEnabled()) {
-                    sendCodeButton.setBackground(THEME_COLOR);
-                }
-            }
-        });
-        
         // 瀵嗙爜 - 鏍囩宸﹀榻�
         passLabel = new JLabel("瀵嗙爜");
         passLabel.setFont(new Font("PingFang SC", Font.BOLD, 13));
@@ -321,36 +303,16 @@
         passwordHintLabel.setForeground(Color.RED);
         passwordHintLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
         
-        // 娉ㄥ唽鎸夐挳 - 鍗曠嫭涓�琛岋紝闀垮害涓庢枃鏈鐩稿悓
-        registerButton = new JButton("娉ㄥ唽");
-        registerButton.setBackground(THEME_COLOR);
-        registerButton.setForeground(Color.WHITE);
+        // 娉ㄥ唽鎸夐挳 - 浣跨敤buttonset鍒涘缓锛岄暱搴︿笌鏂囨湰妗嗙浉鍚�
+        registerButton = buttonset.createStyledButton("娉ㄥ唽", THEME_COLOR);
         registerButton.setFont(new Font("PingFang SC", Font.BOLD, 14));
         registerButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, 40));
-        registerButton.setBorderPainted(false);
-        registerButton.setFocusPainted(false);
-        registerButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
         registerButton.setAlignmentX(Component.LEFT_ALIGNMENT);
         
-        // 娉ㄥ唽鎸夐挳鎮仠鏁堟灉
-        registerButton.addMouseListener(new MouseAdapter() {
-            public void mouseEntered(MouseEvent e) {
-                registerButton.setBackground(THEME_HOVER_COLOR);
-            }
-            public void mouseExited(MouseEvent e) {
-                registerButton.setBackground(THEME_COLOR);
-            }
-        });
-        
-        // 鍙栨秷鎸夐挳 - 鍗曠嫭涓�琛岋紝闀垮害涓庢枃鏈鐩稿悓
-        cancelButton = new JButton("鍙栨秷");
-        cancelButton.setBackground(Color.LIGHT_GRAY);
-        cancelButton.setForeground(Color.DARK_GRAY);
+        // 鍙栨秷鎸夐挳 - 浣跨敤buttonset鍒涘缓锛岄暱搴︿笌鏂囨湰妗嗙浉鍚�
+        cancelButton = buttonset.createStyledButton("鍙栨秷", Color.LIGHT_GRAY);
         cancelButton.setFont(new Font("PingFang SC", Font.BOLD, 14));
         cancelButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, 40));
-        cancelButton.setBorderPainted(false);
-        cancelButton.setFocusPainted(false);
-        cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
         cancelButton.setAlignmentX(Component.LEFT_ALIGNMENT);
         
         // 缁勮琛ㄥ崟 - 缂╁皬琛岄棿璺�

--
Gitblit v1.10.0