Package javax.swing

Examples of javax.swing.JTree.expandPath()


    }
   
    private void expand() {
       
            JTree tree = getContainer().getTree();
            tree.expandPath(tree.getLeadSelectionPath());
       
    }
   
    private void collapse() {
       
View Full Code Here


    DefaultTreeModel model = new DefaultTreeModel(root);
    JTree tree = treePane.getTree();
    tree.setModel(model);
    tree.setRootVisible(false);
    tree.setVisibleRowCount(20);
    tree.expandPath(new TreePath(root));
    tree.setCellRenderer(new IndexTreeCellRenderer());
    addPopupMenu();

    treeScroll.setPreferredSize(
        new Dimension(2 * treeScroll.getPreferredSize().width,
 
View Full Code Here

    });
    JTree tree = treePane.getTree();
    repopulateTree(tree, true);
    tree.setRootVisible(true);
    tree.setVisibleRowCount(20);
    tree.expandPath(new TreePath(getRoot(tree)));
    tree.setCellRenderer(new GeneralMonitoringTreeCellRenderer());
    treeScroll.setPreferredSize(
        new Dimension(treeScroll.getPreferredSize().width + 30,
            3 * treeScroll.getPreferredSize().height));
    entryPane.displayMessage(NO_ELEMENT_SELECTED);
View Full Code Here

    DefaultMutableTreeNode root = new DefaultMutableTreeNode(
        "myserver.mydomain.com:389");
    DefaultTreeModel model = new DefaultTreeModel(root);
    tree.setModel(model);
    tree.setShowsRootHandles(false);
    tree.expandPath(new TreePath(root));
    JPanel p = new JPanel(new GridBagLayout());
    p.setBackground(ColorAndFontConstants.background);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
View Full Code Here

    DefaultTreeModel model = new DefaultTreeModel(root);
    JTree tree = treePane.getTree();
    tree.setModel(model);
    tree.setRootVisible(false);
    tree.setVisibleRowCount(20);
    tree.expandPath(new TreePath(root));
    tree.setCellRenderer(new SchemaTreeCellRenderer());
    addPopupMenu();
    treeScroll.setPreferredSize(
        new Dimension((3 * treeScroll.getPreferredSize().width) / 2,
            5 * treeScroll.getPreferredSize().height));
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.