0
由于某种原因,我的JFrame没有关闭按钮?我试着改变代码,但它似乎没有工作。JFrame没有关闭窗口?
public NewJFrame()
{
this.setUndecorated(true);
this.setVisible(true);
initComponents();
this.setDefaultCloseOperation(NewJFrame.EXIT_ON_CLOSE);
Toolkit tk = Toolkit.getDefaultToolkit();
int x = (int) tk.getScreenSize().getWidth();
int y = (int) tk.getScreenSize().getHeight();
this.setSize(x,y);
}
尝试用鼠标手动调整大小 - 可能是关闭按钮只是隐藏 –
不能调整JFrame的大小。 – Swiper
类似的问题已回答[here](https://stackoverflow.com/questions/7799940/jframe-exit-on-close-java) – firefighter