java - Eclipse RCP 中的 JInternalFrame 替代方案

标签 java swing swt eclipse-rcp

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

相关文章:

java - 是否可以让单个文档监听器在 Swing 中监听多个文本字段

java - 如何在 SWT Canvas 中显示快速变化的图像? (没有快速调用 paintControl() 监听器方法)

java - "Fixing"SWT 表中的前几列,以防止它们水平滚动

Java 字母转大写

java - 为什么 tomcat 服务器在 eclipse 中无法正常启动?

java - JPanel 中 JLabel 的间距问题

java - 如何在按下 JButton 时更改 boolean 值

java - 在 Java 中绘制二维数组

java - GridBagLayout 上的 swing 替换组件

java - 将监听器添加到下拉菜单