不用windowClosing()啊,如果你点关,当前的Frame自己就会关回到主窗口。如果你再加一个“退出”的按钮,只用在Button中加入ActionListner,实现actionPerformed(ActionEvent e)就行了,如下:
JButton exit = new JButton("EXIT");
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
dispose(); // Closes the dialog
}
});
JButton exit = new JButton("EXIT");
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
dispose(); // Closes the dialog
}
});
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货