我想构建一个具有默认大小的 JFrame。但点击默认全屏按钮后,边框将覆盖显示器的全屏,边框内的内容将根据新的边框大小重新调整。
我的问题是我该怎么做?
这是我到目前为止编写的代码。
public class ApplicationFrame extends JFrame{
private static ApplicationFrame ref;
private ApplicationFrame(){
ref=this;
this.setTitle("Business Management");
this.setBounds(50, 50, 1400, 800);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static ApplicationFrame getRef(){
if(ApplicationFrame.ref==null)
new ApplicationFrame();
return ref;
}
}
