我如何使用 JFace API 设置不可调整大小的窗口。考虑下面创建应用程序窗口的代码。我找不到任何方法来设置窗口在 shell 对象或应用程序窗口父级上不可调整大小。我有什么遗漏的吗?
public class Application extends ApplicationWindow
{
public Application()
{
super(null);
}
protected Control createContents(Composite parent)
{
prepareShell();
return parent;
}
protected void prepareShell() {
Shell shell = getShell();
shell.setSize(450, 300);
}
public static void main(String[] args)
{
Application app = new Application();
app.setBlockOnOpen(true);
app.open();
Display.getCurrent().dispose();
}
}
感谢您的帮助。
最佳答案
据我了解,您希望在创建 shell 之前设置 shell 样式位。
只需添加
@Override
public void create() {
setShellStyle(SWT.DIALOG_TRIM);
super.create();
}
到你的类(class),这样做。这省略了 SWT.RESIZE 样式位,因此阻止调整大小..
关于java - 使用 JFace 的不可调整大小的窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5191515/