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) { // 忽略启动过程中可能发生的异常,避免主线程崩溃 } }); } }