如何在 Eclipse Java WindowBuilder 中制作这样的组件?

How do I make a component like this in Eclipse Java WindowBuilder?

我想制作这样一个tree-like组件有很多根。我应该使用什么组件? JTree 不允许多个 parents.

您可以通过使用普通 JTree 并将 setRootVisible 属性 设置为 false

来实现
 jTree.setRootVisible(false);

例子

   JFrame frame = new JFrame();

   ///adding mock data
    DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
    for (int i = 1; i < 5; i++) {
        DefaultMutableTreeNode parent = new DefaultMutableTreeNode("Parent" + i);
        for (int j = 1; j < 5; j++) {
            parent.add(new DefaultMutableTreeNode("Child" + j));
        }
        root.add(parent);
    }

    DefaultTreeModel model = new DefaultTreeModel(root);
    JTree tree = new JTree(model);

    tree.setRootVisible(false);//To hide root

    frame.add(new JScrollPane(tree));
    frame.setTitle("Tree RootHide Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);

示例输出