gpt4 book ai didi

java - JFrame.setBounds 不适用于小值

转载 作者:行者123 更新时间:2023-12-01 23:51:10 26 4
gpt4 key购买 nike

这是我继承自 JFrame 的一个小类的构造函数:

public ToolView(Controller controller) {
super("Tools");
setLayout(null);
setBounds(10, 100, 110, 800);
setResizable(false);

final BaseTool[] tools = {new MoveTool()};
for(int i=0; i<tools.length; i++) {
tools[i].setBounds(2, 2 + i * 50, 50, 50);
add(tools[i]);
}

setVisible(true);
}

在 setBounds 方法中,我希望能够将窗口的宽度设置为 60 左右。显示的代码表示 110。小于 120 左右的值似乎显示大约 120 的窗口大小。我怎样才能得到 window 更薄吗?

最佳答案

How can I get window to be skinnier?

做到undecorated .

关于java - JFrame.setBounds 不适用于小值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16291104/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com