张世豪
7 天以前 f784463ab019c1113cf0b31a249e8802b07a57fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package zhuye;
 
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
 
import udpdell.UDPServer;
 
/**
 * 程序入口启动类(Swing 桌面启动器)。
 * 使用此类作为运行配置的主类,保证有明确的 main 方法。
 */
public class AppLauncher {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame("AutoMow - 首页");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(400, 800);
            frame.setLocationRelativeTo(null);
 
            Shouye shouye = new Shouye();
            frame.add(shouye);
 
            frame.setVisible(true);
            // 启动数据接收线程(如果已实现)
            try {
                UDPServer.startAsync();
            } catch (Throwable ignored) {
                // 忽略启动过程中可能发生的异常,避免主线程崩溃
            }
        });
    }
}