gpt4 book ai didi

java - Eclipse RCP 中的 JInternalFrame 替代方案

转载 作者:行者123 更新时间:2023-12-01 23:18:47 24 4
gpt4 key购买 nike

我在 Swing 中有一个应用程序,它具有自由 float 的 JInternalFrame。我计划将我的应用程序迁移到 Eclipse RCP。 Eclipse SWT 中有其他替代方案吗?

最佳答案

我想你可能想看看

org.eclipse.swt.widgets.Decorations

阅读文档以了解其支持的更多 SWT 样式。

示例:

 public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(600, 400);
shell.setText("Decorations Example");
shell.setLayout(new GridLayout(1,true));

Decorations d1 = new Decorations(shell, SWT.NO_TRIM);
d1.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_CYAN));

Decorations d2 = new Decorations(shell, SWT.DIALOG_TRIM);
d2.setText("dialog");

Decorations d3 = new Decorations(shell, SWT.SHELL_TRIM);
d3.setText("shell trim");

Decorations d4 = new Decorations(shell, SWT.TOOL);
d4.setText("tool");
d4.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_DARK_YELLOW));
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

关于java - Eclipse RCP 中的 JInternalFrame 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20840918/

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