我在 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/