Package com.sun.treetable

Examples of com.sun.treetable.JTreeTable


    expandEntireTree(tree, p);
   }
  }

  protected JTreeTable createTreeTable(TreeTableModel model) {
   JTreeTable treeTable = new JTreeTable(model);
   treeTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
   TableColumnModel columnModel = treeTable.getColumnModel();
   //Operation column increased
   columnModel.getColumn(1).setPreferredWidth(300);
   //Options column increased
   columnModel.getColumn(2).setPreferredWidth(100);
   JTree treeTableTree = treeTable.getTree();
   treeTableTree.setCellRenderer(new PlanTreeCellRenderer());
   //Expand all of the rows in the tree if the root is non null.
   Object root = treeTableTree.getModel().getRoot();
   if (root != null) {
    TreePath p = new TreePath(root);
View Full Code Here


   root.addChild(child2);
   child2.addChild(child3);
   child2.addChild(child5);
   child3.addChild(child4);
   TreeTableModel model = new ExplainPlanModel(root);
   JTreeTable treeTable = new JTreeTable(model);
   int rowCount = treeTable.getTree().getRowCount();
   for (int i=0;i<rowCount;i++) {
    treeTable.getTree().expandRow(i);
   }
   frame.getContentPane().add(new javax.swing.JScrollPane(treeTable));
   frame.setSize(640, 480);
   frame.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
   frame.setVisible(true);
View Full Code Here

TOP

Related Classes of com.sun.treetable.JTreeTable

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.