| | |
| | | import ui.UIConfig; |
| | | import login.EmailCodeSender; |
| | | import login.UserRegister; |
| | | import publicway.buttonset; |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | |
| | | )); |
| | | 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)); |
| | |
| | | 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); |
| | | |
| | | // 组装表单 - 缩小行间距 |