public static void MyFrame(){ Container a = jf.getContentPane(); setBounds(200,200,120,120); JButton cn = new JButton("开始游戏"); cn.setBounds(190,105,90,25); a.add(cn); JF.setUndecorated(true); JF.getRootPane().setWindowDecorationStyle(JRootPane.QUESTION_DIALOG); cn.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent a){ cn.setVisible(false); JF.setVisible(true); JF.setSize(600,400); JF.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); KS.name(); Thread.sleep(1000); // 这里一写休眠或者引导其他类(类名.main(null))就会卡住 } }); }
为啥按钮点击事件里面一写休眠或者引导其他类(类名.main(null))就会卡住???怎么回事?
相关分类