| | |
| | | public static void launchMainApp() { |
| | | System.out.println("准备打开主应用程序..."); |
| | | |
| | | SwingUtilities.invokeLater(() -> { |
| | | JFrame mainFrame = new JFrame("智能割草系统"); |
| | | mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
| | | 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); |
| | | // 设置与登录页面相同的尺寸 |
| | | 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); |
| | | |
| | | System.out.println("主应用程序已启动"); |
| | | |
| | | // 启动后连接MQTT |
| | | new Thread(() -> { |
| | | System.out.println("正在连接MQTT服务器..."); |
| | | Client.lianjiemqqt(); |
| | | }).start(); |
| | | System.out.println("主应用程序已启动"); |
| | | |
| | | // 启动后连接MQTT |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | System.out.println("正在连接MQTT服务器..."); |
| | | Client.lianjiemqqt(); |
| | | } |
| | | }).start(); |
| | | } |
| | | }); |
| | | } |
| | | |