Demos and Usage of javax.swing.JTree.setModel(TreeModel newModel)


   1:     
   2:     private final JTree TREE;
   3: 
   4:         ...
   5:     OptionsTreeManager() {
   6:         TREE = new JTree();
   7:         TREE.setEditable(false);
   8:         ...
   9:         TREE.setRootVisible(false);
  10:         TREE.putClientProperty("JTree.lineStyle", "None");    
  11:         TREE.getSelectionModel().setSelectionMode
  12:         ...
  13: 
  14:         TREE.setModel(TREE_MODEL.getTreeModel());

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.JTree;
   3: import javax.swing.tree.TreeSelectionModel;
   4:         ...
   5: 
   6:     private final JTree TREE = new JTree();
   7: 
   8:         ...
   9: 
  10:         TREE.setModel(TREE_MODEL.getTreeModel());

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.JTree;
   3: import javax.swing.SwingUtilities;
   4:         ...
   5: class TestSuitePanel extends JPanel implements TestListener {
   6:     private JTree fTree;
   7:     private JScrollPane fScrollTree;
   8:         ...
   9: 
  10:         public Component getTreeCellRendererComponent(JTree tree, Object value,
  11:                 boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  12:         ...
  13:         fTree= new JTree();
  14:         fTree.setModel(null);

View Full Code Here
   1: import javax.swing.JComponent;
   2: import javax.swing.JTree;
   3: import javax.swing.tree.DefaultMutableTreeNode;
   4:         ...
   5:         if (isCompatible(component)) {
   6:             JTree jTree = (JTree) component;
   7:             
   8:         ...
   9:             if(cellRendererParams != null) {
  10:                 jTree.setModel(null);
  11:                 
  12:         ...
  13:                         DefaultTreeModel model = new DefaultTreeModel(node);
  14:                         node.setModel(model);

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.JTree;
   3: import javax.swing.tree.TreePath;
   4:         ...
   5:     
   6:     private final JTree TREE;
   7: 
   8:         ...
   9:     OptionsTreeManager() {
  10:         TREE = new JTree();
  11:         TREE.setEditable(false);
  12:         ...
  13:                 
  14:         TREE.setModel(FILTERED_TREE_MODEL);

View Full Code Here
   1:     private JButton fReload;
   2:     private JTree fTree;
   3:     private TestTreeModel fModel;
   4:         ...
   5: 
   6:         public Component getTreeCellRendererComponent(JTree tree, Object value,
   7:                 boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
   8:         ...
   9: 
  10:         fTree= new JTree();
  11:         fTree.setRowHeight(20);
  12:         ...
  13:         fModel= new TestTreeModel(root);
  14:         fTree.setModel(fModel);

View Full Code Here
   1:         
   2:     protected JTree tree = null;
   3:     
   4:         ...
   5:     private void initializeTree() {
   6:         tree = new JTree();
   7:         tree.setCellRenderer(new CustomTreeRenderer());
   8:         ...
   9:     public void setTreeModel(TreeModel aModel) {        
  10:         tree.setModel(aModel);    
  11:             
  12:         ...
  13:         public Component getTreeCellRendererComponent(
  14:             JTree tree, Object value, 

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.JTree;
   3: import javax.swing.SwingConstants;
   4:         ...
   5:         ctm = new ConfigureTreeModel();
   6:         tree = new JTree();
   7:         title = new JLabel();
   8:         ...
   9: 
  10:         tree.setModel(ctm);
  11:         tree.setCellRenderer(dtcr);
  12:         ...
  13: 
  14:     protected JTree tree;

View Full Code Here
   1: 
   2:   private JTree tree;
   3:   private JextFrame parent;
   4:         ...
   5:     treeModel = new DefaultTreeModel(root);
   6:     tree = new JTree(treeModel);
   7:     tree.addTreeSelectionListener(this);
   8:         ...
   9:     tree.putClientProperty("JTree.lineStyle", "Angled");
  10: 
  11:         ...
  12: 
  13:     tree.setModel(_model);

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.JTree;
   3: import javax.swing.event.TreeSelectionEvent;
   4:         ...
   5: 
   6:     private JTree tree;
   7:     private JComboBox combo;
   8:         ...
   9:             tree.setShowsRootHandles(true);
  10:             tree.setModel(curPerspective);
  11:         }

View Full Code Here
   1: import javax.swing.JList;
   2: import javax.swing.JTree;
   3: import javax.swing.tree.DefaultMutableTreeNode;
   4:         ...
   5: 
   6:    public void loadLinks(NodeInfo ni, JTree tree) {
   7: 
   8:         ...
   9: 
  10:       tree.setModel(defaultTreeModel);
  11:       tree.repaint();
  12:         ...
  13: 
  14:    public void cleanTree(JTree tree) {

View Full Code Here
   1: import javax.swing.JSplitPane;
   2: import javax.swing.JTree;
   3: import javax.swing.ToolTipManager;
   4:         ...
   5:     {
   6:         treAvailable = new JTree();
   7:         ToolTipManager.sharedInstance().registerComponent(treAvailable);
   8:         ...
   9:     {
  10:         treAvailable.setModel(createTreeModel(books));
  11:     }
  12:         ...
  13: 
  14:     private JTree treAvailable;

View Full Code Here
   1:             pc.setBioMDI(this);
   2:             projectTree.setModel(null);
   3: 
   4:         ...
   5:         treeScroll = new javax.swing.JScrollPane();
   6:         projectTree = new javax.swing.JTree();
   7:         errorReportPanel = new javax.swing.JPanel();
   8:         ...
   9: 
  10:                     projectTree.setModel(pc.updateTree());
  11:                 } catch (Exception e)
  12:         ...
  13:     {
  14:         this.projectTree.setModel(this.pc.updateTree());

View Full Code Here