简体   繁体   English

你能阻止 jframe 的标题栏在不删除它的情况下调整 jframe 的大小吗?

[英]Can you stop a jframe's title bar from resizing the jframe without removing it?

This is a picture of the jframe in the design view vs when I'm actually running it.这是设计视图中的 jframe 与我实际运行它时的图片。 The title bar causes some components to be cut out of the frame.标题栏会导致一些组件被切出框架。

Is there any way to fix this without removing the title bar?有没有办法在不删除标题栏的情况下解决这个问题? I'm using "Null Layout" on my frame.我在我的框架上使用“空布局”。

Try adding this code into your constructor just below the initcomponents() method:尝试将此代码添加到initcomponents()方法下方的构造函数中:

setExtendedState(JFrame.MAXIMIZED_BOTH);

If this doesn't work, please update your answer with the code.如果这不起作用,请使用代码更新您的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM