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

huangapple go评论77阅读模式
英文:

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

问题

这是在设计视图中的jframe图片与实际运行时的对比。标题栏导致一些组件被剪切出框架外。

有没有办法在不移除标题栏的情况下解决这个问题?
我在我的框架上使用了“Null Layout”。

英文:

This is a picture of the jframe in the design view vs when I'm actually running it. 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.

答案1

得分: -1

将以下代码添加到您的构造函数中,就在initcomponents()方法的下方:

setExtendedState(JFrame.MAXIMIZED_BOTH);

如果这不起作用,请更新您的回答并附上代码。

英文:

Try adding this code into your constructor just below the initcomponents() method:

setExtendedState(JFrame.MAXIMIZED_BOTH);

If this doesn't work, please update your answer with the code.

huangapple
  • 本文由 发表于 2020年10月24日 19:27:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/64512846.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定