Package javax.swing

Examples of javax.swing.JTree


        appli = parent;

        // tree section.
        rootNode = new DefaultMutableTreeNode("Options");
        treeModel = new DefaultTreeModel(rootNode);
        treeSections = new JTree(treeModel);
        treeSections.setEditable(false);
        treeSections.setBackground(new Color(1.0f, 1.0f, 1.0f));
        treeSections.setShowsRootHandles(true);
        treeSections.setRowHeight(20);
        treeSections.setRootVisible(false);
View Full Code Here


        firstCategoryEnglishName.equals(firstCategoryFrenchName));
    assertFalse("Same name for first piece",
        firstPieceEnglishName.equals(firstPieceFrenchName));

    // 3. Create a tree from default catalog
    JTree tree = new FurnitureCatalogTree(catalog);

    // Check root isn't visible and root handles are showed
    assertFalse("Root is visible", tree.isRootVisible());
    assertTrue("Handles not showed", tree.getShowsRootHandles());
   
    // 4. Check alphabetical order of categories and furniture in tree
    assertTreeIsSorted(tree);
  }
View Full Code Here

        if (!(source instanceof JTree)) {
            return;
        }

        JTree    tree     = (JTree) source;
        TreePath treePath = tree.getPathForLocation(e.getX(), e.getY());

        // if we couldn't find a tree path that corresponds to the
        // right-click, then return
        if (treePath == null) {
            return;
View Full Code Here

        pResult.add(gScrollPane, BorderLayout.CENTER);

        // Set up the tree
        rootNode    = new DefaultMutableTreeNode("Connection");
        treeModel   = new DefaultTreeModel(rootNode);
        tTree       = new JTree(treeModel);
        tScrollPane = new JScrollPane(tTree);

        // System.out.println("Adding mouse listener");
        tTree.addMouseListener(this);
        tScrollPane.setPreferredSize(new Dimension(120, 400));
View Full Code Here

       BevelBorder bb = new BevelBorder(BevelBorder.LOWERED);
       CompoundBorder cb = new CompoundBorder(eb,bb);
       this.setBorder(new CompoundBorder(cb,eb));

       // Set up the tree
       JTree tree = new JTree(new DomToTreeModelAdapter());

       // Iterate over the tree and make nodes visible
       // (Otherwise, the tree shows up fully collapsed)
       // TreePath nodePath = ???;
       //  tree.expandPath(nodePath);
View Full Code Here

    assertEquals("Wrong walls count", 5, frame.home.getWalls().size());

    // 3. Use SELECTION mode
    tester.click(frame.selectButton);
    // Select the first piece in catalog tree
    JTree catalogTree = (JTree)
        frame.homeController.getFurnitureCatalogController().getView();
    catalogTree.expandRow(0);
    catalogTree.addSelectionInterval(1, 1);
    // Click on Add furniture button
    tester.click(frame.addButton);
    // Check home contains one selected piece
    tester.waitForIdle();
    assertEquals("Wrong piece count",
View Full Code Here

        }
        showTree(t);
    }

    static void showTree(Template t) {
        JTree tree = new JTree(t.getRootTreeNode());
        JFrame jf = new JFrame(t.getName());
        jf.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
View Full Code Here

    public JOBRAdmin() {
      setLayout(new BorderLayout());


      recordTree = new JTree(new TopNode("[not loaded]"));
      recordTree.setRootVisible(true);

      // Must be registered for renderer tooltips to work
      ToolTipManager.sharedInstance().registerComponent(recordTree);
View Full Code Here

  protected static class TreeExpansionHandler implements TreeExpansionListener {
    public void treeExpanded(final TreeExpansionEvent evt) {
      // The expanded path
      final TreePath path = evt.getPath();
      // The tree
      final JTree tree = (JTree) evt.getSource();

      // Get the last component of the path and
      // arrange to have it fully populated.
      final FileTreeNode node = (FileTreeNode) path.getLastPathComponent();
      if (node.populateDirectories(true)) {
        ((DefaultTreeModel) tree.getModel()).nodeStructureChanged(node);
      }
    }
View Full Code Here

  public JTreePanel(DefaultMutableTreeNode rootNode){
    this.rootNode = rootNode;
    this.plugsNode = new DefaultMutableTreeNode(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Plugins"));
    this.rootNode.add(plugsNode);
    this.treeModel = new DefaultTreeModel(rootNode);
    this.tree = new JTree(treeModel);
    init();
    setViewportView(this.tree);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JTree

Copyright © 2018 www.massapicom. 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.