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/Denglu.java | 343 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 182 insertions(+), 161 deletions(-)
diff --git a/src/denglu/Denglu.java b/src/denglu/Denglu.java
index d1af97c..6c46648 100644
--- a/src/denglu/Denglu.java
+++ b/src/denglu/Denglu.java
@@ -8,6 +8,9 @@
import set.Setsys;
import udpdell.UDPServer;
import user.Usrdell;
+import Mqttmessage.Client;
+import login.LoginVerifier;
+import publicway.buttonset;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
@@ -20,11 +23,10 @@
private JPasswordField passwordField;
private JCheckBox rememberMe;
private JButton loginButton;
- private JButton registerButton;
private Map<String, Map<String, String>> translations;
private JPanel mainPanel;
private JLabel usernameLabel, passwordLabel;
- private JLabel forgotPassword, noAccountLabel, signupLink, appInfoLabel;
+ private JLabel forgotPassword, noAccountLabel, signupLink;
// 涓婚棰滆壊
private final Color THEME_COLOR = new Color(46, 139, 87);
@@ -54,7 +56,6 @@
zh.put("sign_up", "绔嬪嵆娉ㄥ唽");
zh.put("app_title", "鏅鸿兘鍓茶崏绯荤粺");
zh.put("window_title", "鏅鸿兘鍓茶崏绯荤粺 - 鐧诲綍");
- zh.put("app_info", "鏅鸿兘鍓茶崏绯荤粺 漏 2023 - 鏅鸿兘鍓茶崏瑙e喅鏂规");
zh.put("register_button", "娉ㄥ唽鏂拌处鎴�");
translations.put("zh", zh);
@@ -69,7 +70,6 @@
en.put("sign_up", "Sign Up");
en.put("app_title", "Smart Mowing System");
en.put("window_title", "Smart Mowing System - Login");
- en.put("app_info", "Smart Mowing System 漏 2023 - Intelligent Lawn Care");
en.put("register_button", "Create New Account");
translations.put("en", en);
@@ -84,7 +84,6 @@
es.put("sign_up", "Reg铆strate");
es.put("app_title", "Sistema de Corte Inteligente");
es.put("window_title", "Sistema de Corte Inteligente - Iniciar Sesi贸n");
- es.put("app_info", "Sistema de Corte Inteligente 漏 2023 - Soluciones Inteligentes");
es.put("register_button", "Crear Nueva Cuenta");
translations.put("es", es);
@@ -99,7 +98,6 @@
fr.put("sign_up", "S'inscrire");
fr.put("app_title", "Syst猫me de Tonte Intelligent");
fr.put("window_title", "Syst猫me de Tonte Intelligent - Connexion");
- fr.put("app_info", "Syst猫me de Tonte Intelligent 漏 2023 - Solutions de Tonte");
fr.put("register_button", "Cr茅er un Nouveau Compte");
translations.put("fr", fr);
@@ -114,7 +112,6 @@
de.put("sign_up", "Registrieren");
de.put("app_title", "Intelligentes M盲hsystem");
de.put("window_title", "Intelligentes M盲hsystem - Anmeldung");
- de.put("app_info", "Intelligentes M盲hsystem 漏 2023 - M盲hl枚sungen");
de.put("register_button", "Neues Konto Erstellen");
translations.put("de", de);
}
@@ -156,18 +153,12 @@
// 涓昏〃鍗曞尯鍩�
JPanel formPanel = createFormPanel();
- // 鍖呰鍦ㄦ粴鍔ㄧ獥鏍间腑锛屼互闃插唴瀹规樉绀轰笉鍏�
- JScrollPane scrollPane = new JScrollPane(formPanel);
- scrollPane.setBorder(null);
- scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- scrollPane.getVerticalScrollBar().setUnitIncrement(16);
-
- // 搴曢儴搴旂敤淇℃伅
- JPanel appInfoPanel = createAppInfoPanel();
+ // 搴曢儴闈㈡澘锛堝寘鍚敞鍐岄摼鎺ワ級
+ JPanel bottomPanel = createBottomPanel();
mainPanel.add(topPanel, BorderLayout.NORTH);
- mainPanel.add(scrollPane, BorderLayout.CENTER);
- mainPanel.add(appInfoPanel, BorderLayout.SOUTH);
+ mainPanel.add(formPanel, BorderLayout.CENTER);
+ mainPanel.add(bottomPanel, BorderLayout.SOUTH);
add(mainPanel);
}
@@ -230,75 +221,21 @@
rememberForgotPanel.add(rememberMe, BorderLayout.WEST);
rememberForgotPanel.add(forgotPassword, BorderLayout.EAST);
- // 鐧诲綍鎸夐挳 - 姘村钩灞呬腑锛岄暱搴︿笌鏂囨湰妗嗗搴︿繚鎸佺浉杩�
+ // 鐧诲綍鎸夐挳 - 浣跨敤buttonset鍒涘缓锛屾按骞冲眳涓紝闀垮害涓庢枃鏈瀹藉害淇濇寔鐩歌繎
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
buttonPanel.setBackground(Color.WHITE);
buttonPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 50));
- loginButton = new JButton("鐧诲綍");
- loginButton.setBackground(THEME_COLOR);
- loginButton.setForeground(Color.WHITE);
+ // 浣跨敤buttonset鍒涘缓鐧诲綍鎸夐挳锛屼娇鐢ㄤ富棰樿壊
+ loginButton = buttonset.createStyledButton("鐧诲綍", THEME_COLOR);
loginButton.setFont(new Font("PingFang SC", Font.BOLD, 15));
// 璁剧疆鐧诲綍鎸夐挳闀垮害鎺ヨ繎鏂囨湰妗嗗搴�
loginButton.setPreferredSize(new Dimension(300, 48));
- loginButton.setBorderPainted(false);
- loginButton.setFocusPainted(false);
- loginButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
-
- // 榧犳爣鎮仠鏁堟灉
- loginButton.addMouseListener(new MouseAdapter() {
- public void mouseEntered(MouseEvent e) {
- loginButton.setBackground(THEME_HOVER_COLOR);
- }
- public void mouseExited(MouseEvent e) {
- loginButton.setBackground(THEME_COLOR);
- }
- });
+ loginButton.setMinimumSize(new Dimension(300, 48));
+ loginButton.setMaximumSize(new Dimension(300, 48));
buttonPanel.add(loginButton);
- // 娉ㄥ唽鎸夐挳 - 鏇存槑鏄剧殑娉ㄥ唽鍏ュ彛
- JPanel registerButtonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
- registerButtonPanel.setBackground(Color.WHITE);
- registerButtonPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 45));
-
- registerButton = new JButton("娉ㄥ唽鏂拌处鎴�");
- registerButton.setBackground(Color.WHITE);
- registerButton.setForeground(THEME_COLOR);
- registerButton.setFont(new Font("PingFang SC", Font.BOLD, 14));
- registerButton.setPreferredSize(new Dimension(180, 42));
- registerButton.setBorder(BorderFactory.createCompoundBorder(
- BorderFactory.createLineBorder(THEME_COLOR),
- BorderFactory.createEmptyBorder(5, 15, 5, 15)
- ));
- registerButton.setFocusPainted(false);
- registerButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
-
- // 娉ㄥ唽鎸夐挳鎮仠鏁堟灉
- registerButton.addMouseListener(new MouseAdapter() {
- public void mouseEntered(MouseEvent e) {
- registerButton.setBackground(new Color(240, 250, 240));
- }
- public void mouseExited(MouseEvent e) {
- registerButton.setBackground(Color.WHITE);
- }
- });
-
- registerButtonPanel.add(registerButton);
-
- // 娉ㄥ唽閾炬帴锛堜繚鐣欏師鏈夌殑鏂囨湰閾炬帴锛�
- JPanel signupPanel = new JPanel();
- signupPanel.setBackground(Color.WHITE);
- noAccountLabel = new JLabel("杩樻病鏈夎处鎴凤紵 ");
- noAccountLabel.setFont(new Font("PingFang SC", Font.PLAIN, 12));
- noAccountLabel.setForeground(new Color(120, 120, 120));
- signupLink = new JLabel("绔嬪嵆娉ㄥ唽");
- signupLink.setFont(new Font("PingFang SC", Font.BOLD, 12));
- signupLink.setForeground(THEME_COLOR);
- signupLink.setCursor(new Cursor(Cursor.HAND_CURSOR));
- signupPanel.add(noAccountLabel);
- signupPanel.add(signupLink);
-
// 缁勮琛ㄥ崟
formPanel.add(Box.createRigidArea(new Dimension(0, 15)));
formPanel.add(usernameLabel);
@@ -312,26 +249,33 @@
formPanel.add(rememberForgotPanel);
formPanel.add(Box.createRigidArea(new Dimension(0, 20)));
formPanel.add(buttonPanel); // 鐧诲綍鎸夐挳
- formPanel.add(Box.createRigidArea(new Dimension(0, 15)));
- formPanel.add(registerButtonPanel); // 娉ㄥ唽鎸夐挳
- formPanel.add(Box.createRigidArea(new Dimension(0, 15)));
- formPanel.add(signupPanel); // 淇濈暀鍘熸湁鐨勬敞鍐岄摼鎺�
return formPanel;
}
- private JPanel createAppInfoPanel() {
- JPanel appInfoPanel = new JPanel();
- appInfoPanel.setBackground(Color.WHITE);
- appInfoPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
- appInfoLabel = new JLabel(
- getTranslationValue(currentLanguageCode, "app_info", "鏅鸿兘鍓茶崏绯荤粺 漏 2023")
- );
- appInfoLabel.setFont(new Font("PingFang SC", Font.PLAIN, 10));
- appInfoLabel.setForeground(new Color(150, 150, 150));
- appInfoPanel.add(appInfoLabel);
+ private JPanel createBottomPanel() {
+ JPanel bottomPanel = new JPanel();
+ bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.Y_AXIS));
+ bottomPanel.setBackground(Color.WHITE);
- return appInfoPanel;
+ // 娉ㄥ唽閾炬帴锛堟斁鍒伴〉闈㈡渶涓嬫柟锛�
+ JPanel signupPanel = new JPanel();
+ signupPanel.setBackground(Color.WHITE);
+ noAccountLabel = new JLabel("杩樻病鏈夎处鎴凤紵 ");
+ noAccountLabel.setFont(new Font("PingFang SC", Font.PLAIN, 12));
+ noAccountLabel.setForeground(new Color(120, 120, 120));
+ signupLink = new JLabel("绔嬪嵆娉ㄥ唽");
+ signupLink.setFont(new Font("PingFang SC", Font.BOLD, 12));
+ signupLink.setForeground(THEME_COLOR);
+ signupLink.setCursor(new Cursor(Cursor.HAND_CURSOR));
+ signupPanel.add(noAccountLabel);
+ signupPanel.add(signupLink);
+ signupPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
+
+ // 娉ㄥ唽閾炬帴鏀惧湪鏈�搴曢儴
+ bottomPanel.add(signupPanel);
+
+ return bottomPanel;
}
private void setupEventHandlers() {
@@ -350,10 +294,7 @@
// 蹇樿瀵嗙爜鐐瑰嚮浜嬩欢
forgotPassword.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
- JOptionPane.showMessageDialog(Denglu.this,
- "璇疯仈绯荤鐞嗗憳閲嶇疆瀵嗙爜",
- "蹇樿瀵嗙爜",
- JOptionPane.INFORMATION_MESSAGE);
+ new user.ZhaohuiMima(Denglu.this).setVisible(true);
}
});
@@ -363,9 +304,6 @@
openRegistrationWindow();
}
});
-
- // 娉ㄥ唽鎸夐挳鐐瑰嚮浜嬩欢 - 鎵撳紑娉ㄥ唽绐楀彛
- registerButton.addActionListener(e -> openRegistrationWindow());
}
private void updateLanguage(String language) {
@@ -382,10 +320,6 @@
loginButton.setText(getTranslationValue(langCode, "login_button", loginButton.getText()));
noAccountLabel.setText(getTranslationValue(langCode, "no_account", noAccountLabel.getText()));
signupLink.setText(getTranslationValue(langCode, "sign_up", signupLink.getText()));
- appInfoLabel.setText(getTranslationValue(langCode, "app_info", appInfoLabel.getText()));
-
- // 鏇存柊娉ㄥ唽鎸夐挳鏂囨湰
- registerButton.setText(getTranslationValue(langCode, "register_button", registerButton.getText()));
// 鏇存柊绐楀彛鏍囬
setTitle(getTranslationValue(langCode, "window_title", getTitle()));
@@ -446,11 +380,17 @@
boolean isRemember = "1".equals(rememberPwd);
rememberMe.setSelected(isRemember);
- // 濡傛灉璁颁綇鎴戣閫変腑锛屽~鍏呭瘑鐮�
+ // 濡傛灉璁颁綇鎴戣閫変腑锛屽~鍏呭瘑鐮佸苟鑷姩鐧诲綍锛堝欢杩熸墽琛岋紝纭繚绐楀彛宸叉樉绀猴級
if (isRemember) {
String savedPassword = UserChuShiHua.getProperty("password");
- if (savedPassword != null && !savedPassword.equals("-1")) {
+ String savedEmail = UserChuShiHua.getProperty("email");
+ if (savedPassword != null && !savedPassword.equals("-1") &&
+ savedEmail != null && !savedEmail.equals("-1")) {
passwordField.setText(savedPassword);
+ // 寤惰繜鎵ц鑷姩鐧诲綍锛岀‘淇濈獥鍙e凡缁忔樉绀�
+ SwingUtilities.invokeLater(() -> {
+ performAutoLogin(savedEmail, savedPassword);
+ });
}
}
}
@@ -467,11 +407,11 @@
}
private void performLogin() {
- String username = usernameField.getText().trim();
+ String usernameOrEmail = usernameField.getText().trim();
String password = new String(passwordField.getPassword()).trim();
// 杈撳叆楠岃瘉
- if (username.isEmpty()) {
+ if (usernameOrEmail.isEmpty()) {
JOptionPane.showMessageDialog(this,
"璇疯緭鍏ョ敤鎴峰悕鎴栭偖绠�",
"杈撳叆閿欒",
@@ -489,64 +429,149 @@
return;
}
- // 楠岃瘉鐢ㄦ埛鍚嶅拰瀵嗙爜
- if (validateLogin(username, password)) {
- // 鏇存柊鏈�鍚庣櫥褰曟椂闂�
- UserChuShiHua.updateProperty("lastLoginTime", String.valueOf(System.currentTimeMillis()));
-
- // 淇濆瓨璁颁綇鎴戠姸鎬�
- if (rememberMe.isSelected()) {
- UserChuShiHua.updateProperty("rememberPassword", "1");
- UserChuShiHua.updateProperty("userName", username);
- } else {
- UserChuShiHua.updateProperty("rememberPassword", "0");
+ // 鑾峰彇閭鍦板潃锛堝鏋滆緭鍏ョ殑鏄敤鎴峰悕锛屼粠閰嶇疆鏂囦欢涓幏鍙栧搴旂殑閭锛�
+ String email = getEmailFromInput(usernameOrEmail);
+
+ // 绂佺敤鐧诲綍鎸夐挳锛岄槻姝㈤噸澶嶇偣鍑�
+ loginButton.setEnabled(false);
+
+ // 鍦ㄦ柊绾跨▼涓皟鐢ˋPI锛岄伩鍏嶉樆濉濽I
+ new Thread(() -> {
+ try {
+ // 璋冪敤鐧诲綍楠岃瘉API
+ LoginVerifier.LoginVerifyResponse response = LoginVerifier.verifyLogin(email, password);
+
+ // 鍦‥DT绾跨▼涓洿鏂癠I
+ SwingUtilities.invokeLater(() -> {
+ loginButton.setEnabled(true);
+
+ if (response.isSuccess()) {
+ // 鐧诲綍鎴愬姛
+ // 鏇存柊鏈�鍚庣櫥褰曟椂闂�
+ UserChuShiHua.updateProperty("lastLoginTime", String.valueOf(System.currentTimeMillis()));
+
+ // 淇濆瓨璁颁綇鎴戠姸鎬�
+ if (rememberMe.isSelected()) {
+ UserChuShiHua.updateProperty("rememberPassword", "1");
+ UserChuShiHua.updateProperty("userName", usernameOrEmail);
+ UserChuShiHua.updateProperty("email", email);
+ UserChuShiHua.updateProperty("password", password);
+ } else {
+ UserChuShiHua.updateProperty("rememberPassword", "0");
+ }
+
+ // 鍏抽棴鐧诲綍绐楀彛骞舵墦寮�棣栭〉
+ openMainApplication();
+ } else {
+ // 鐧诲綍澶辫触锛屾樉绀洪敊璇俊鎭�
+ String errorMessage = response.getMessage() != null ?
+ response.getMessage() : "鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒锛�";
+ JOptionPane.showMessageDialog(this,
+ errorMessage,
+ "鐧诲綍澶辫触",
+ JOptionPane.ERROR_MESSAGE);
+ passwordField.setText("");
+ passwordField.requestFocus();
+ }
+ });
+ } catch (Exception e) {
+ // 寮傚父澶勭悊锛屾仮澶嶆寜閽苟鏄剧ず閿欒
+ SwingUtilities.invokeLater(() -> {
+ loginButton.setEnabled(true);
+ JOptionPane.showMessageDialog(this,
+ "鐧诲綍鏃跺彂鐢熼敊璇�: " + e.getMessage(),
+ "閿欒",
+ JOptionPane.ERROR_MESSAGE);
+ passwordField.setText("");
+ passwordField.requestFocus();
+ });
}
-
- // 鍏抽棴鐧诲綍绐楀彛骞舵墦寮�棣栭〉
- openMainApplication();
-
- } else {
- JOptionPane.showMessageDialog(this,
- "鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒锛�",
- "鐧诲綍澶辫触",
- JOptionPane.ERROR_MESSAGE);
- passwordField.setText("");
- passwordField.requestFocus();
- }
+ }).start();
}
- private boolean validateLogin(String username, String password) {
- // 浠嶶serChuShiHua鑾峰彇瀛樺偍鐨勭敤鎴锋暟鎹繘琛屾瘮杈�
- String storedUsername = UserChuShiHua.getProperty("userName");
- String storedPassword = UserChuShiHua.getProperty("password");
- String storedEmail = UserChuShiHua.getProperty("email");
-
- // 妫�鏌ョ敤鎴峰悕/閭鍜屽瘑鐮佹槸鍚﹀尮閰�
- boolean usernameMatch = username.equals(storedUsername) || username.equals(storedEmail);
- boolean passwordMatch = password.equals(storedPassword);
-
- return usernameMatch && passwordMatch;
+ // 閭楠岃瘉鏂规硶
+ private boolean isValidEmail(String email) {
+ // 绠�鍗曠殑閭鏍煎紡楠岃瘉
+ String emailRegex = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$";
+ return email != null && email.matches(emailRegex);
+ }
+
+ // 鑾峰彇閭鍦板潃锛堝鏋滆緭鍏ョ殑鏄敤鎴峰悕锛屽垯浠庨厤缃枃浠朵腑鑾峰彇閭锛�
+ private String getEmailFromInput(String usernameOrEmail) {
+ // 濡傛灉杈撳叆鐨勬槸閭鏍煎紡锛岀洿鎺ヨ繑鍥�
+ if (isValidEmail(usernameOrEmail)) {
+ return usernameOrEmail;
+ }
+ // 鍚﹀垯锛屼粠閰嶇疆鏂囦欢涓幏鍙栦繚瀛樼殑閭
+ String savedEmail = UserChuShiHua.getProperty("email");
+ if (savedEmail != null && !savedEmail.equals("-1")) {
+ // 妫�鏌ヨ緭鍏ョ殑鐢ㄦ埛鍚嶆槸鍚﹀尮閰嶄繚瀛樼殑鐢ㄦ埛鍚�
+ String savedUsername = UserChuShiHua.getProperty("userName");
+ if (usernameOrEmail.equals(savedUsername)) {
+ return savedEmail;
+ }
+ }
+ // 濡傛灉鎵句笉鍒伴偖绠憋紝杩斿洖杈撳叆鐨勫瓧绗︿覆锛堝彲鑳芥槸閭鏍煎紡浣嗛獙璇佸け璐ワ紝鎴栬�呯敤鎴峰悕涓嶅瓨鍦級
+ return usernameOrEmail;
+ }
+
+ // 鑷姩鐧诲綍锛堜粠閰嶇疆鏂囦欢璇诲彇閭鍜屽瘑鐮侊級
+ private void performAutoLogin(String email, String password) {
+ // 鍦ㄦ柊绾跨▼涓皟鐢ˋPI锛岄伩鍏嶉樆濉濽I
+ new Thread(() -> {
+ try {
+ LoginVerifier.LoginVerifyResponse response = LoginVerifier.verifyLogin(email, password);
+
+ SwingUtilities.invokeLater(() -> {
+ if (response.isSuccess()) {
+ // 鐧诲綍鎴愬姛锛岃烦杞埌涓婚〉
+ openMainApplication();
+ } else {
+ // 鐧诲綍澶辫触锛屾竻绌哄瘑鐮佸瓧娈碉紝璁╃敤鎴烽噸鏂拌緭鍏�
+ passwordField.setText("");
+ usernameField.requestFocus();
+ }
+ });
+ } catch (Exception e) {
+ // 寮傚父澶勭悊锛屾竻绌哄瘑鐮佸瓧娈�
+ SwingUtilities.invokeLater(() -> {
+ passwordField.setText("");
+ usernameField.requestFocus();
+ });
+ }
+ }).start();
}
private void openMainApplication() {
- System.out.println("鐧诲綍鎴愬姛锛屽噯澶囨墦寮�涓诲簲鐢ㄧ▼搴�...");
+ launchMainApp();
+ dispose();
+ }
- SwingUtilities.invokeLater(() -> {
- JFrame mainFrame = new JFrame("鏅鸿兘鍓茶崏绯荤粺");
- mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+ public static void launchMainApp() {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ JFrame mainFrame = new JFrame("鏅鸿兘鍓茶崏绯荤粺");
+ mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
- Shouye homePanel = new Shouye();
- mainFrame.setContentPane(homePanel);
+ Shouye homePanel = new Shouye();
+ mainFrame.setContentPane(homePanel);
- // 璁剧疆涓庣櫥褰曢〉闈㈢浉鍚岀殑灏哄
- mainFrame.setSize(UIConfig.DIALOG_WIDTH, UIConfig.DIALOG_HEIGHT);
- mainFrame.setMinimumSize(new Dimension(UIConfig.DIALOG_WIDTH, UIConfig.DIALOG_HEIGHT));
- mainFrame.setResizable(false);
- mainFrame.setLocationRelativeTo(null);
- mainFrame.setVisible(true);
-
- dispose();
- System.out.println("鐧诲綍绐楀彛宸插叧闂紝涓诲簲鐢ㄧ▼搴忓凡鍚姩");
+ // 璁剧疆涓庣櫥褰曢〉闈㈢浉鍚岀殑灏哄
+ mainFrame.setSize(UIConfig.DIALOG_WIDTH, UIConfig.DIALOG_HEIGHT);
+ mainFrame.setMinimumSize(new Dimension(UIConfig.DIALOG_WIDTH, UIConfig.DIALOG_HEIGHT));
+ mainFrame.setResizable(true);
+ mainFrame.setLocationRelativeTo(null);
+ mainFrame.setVisible(true);
+
+ // 鍚姩鍚庤繛鎺QTT
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ Client.lianjiemqqt();
+ }
+ }).start();
+ }
});
}
@@ -588,12 +613,8 @@
Device.initializeActiveDevice(setsys.getMowerId());
UDPServer.startAsync();//鍚姩鏁版嵁鎺ユ敹绾跨▼
-
- // 鏄剧ず鍒濆鏁版嵁
- System.out.println("鍒濆鐢ㄦ埛鍚�: " + UserChuShiHua.getProperty("userName"));
- System.out.println("鍒濆瀵嗙爜: " + UserChuShiHua.getProperty("password"));
-
- // 鍚姩鐧诲綍鐣岄潰
+
+ // 鍚姩鐧诲綍鐣岄潰锛堣嚜鍔ㄧ櫥褰曢�昏緫鍦� loadUserPreferences 涓鐞嗭級
EventQueue.invokeLater(() -> {
try {
new Denglu().setVisible(true);
--
Gitblit v1.10.0