Demos and Usage of javax.swing.tree.DefaultTreeModel.addTreeModelListener(TreeModelListener l)


   1:         tree.addMouseListener(new MouseHandle());
   2:         DefaultTreeModel treeModel = (DefaultTreeModel)tree.getModel();
   3:         ...
   4:         treeModel.addTreeModelListener(this);
   5:         
   6:         JScrollPane scrollPane = new JScrollPane();
   7:         scrollPane.setViewportView(tree);

View Full Code Here
   1:     JTree tree = null;
   2:     DefaultTreeModel treeModel = null;
   3:     
   4:         ...
   5:         tree.addMouseListener(new MouseHandle());
   6:         treeModel = (DefaultTreeModel)tree.getModel();
   7:         ...
   8:         treeModel.addTreeModelListener(this);
   9:         

View Full Code Here
   1: 
   2:     public DefaultTreeModel buildTreeModel(ModelParticipant rootModPart)
   3:     {
   4:         ...
   5:     DefaultMutableTreeNode root = new DefaultMutableTreeNode(rootModPart);
   6:     DefaultTreeModel treeModel = new DefaultTreeModel(root);
   7:     treeModel.setAsksAllowsChildren(true);
   8:         ...
   9:             if (!treeModelsListenedTo.containsKey(treeModel)) {
  10:                 treeModel.addTreeModelListener(this);
  11:                 treeModelsListenedTo.put(treeModel,treeModel);

View Full Code Here
   1: import javax.swing.tree.DefaultTreeCellRenderer;
   2: import javax.swing.tree.DefaultTreeModel;
   3: import javax.swing.tree.TreePath;
   4:         ...
   5:   private ExperimentBuilder experimentBuilder;
   6:   private DefaultTreeModel model;
   7:   private ExperimentTree tree;
   8:         ...
   9:     root = new DefaultMutableTreeNode();
  10:     model = new DefaultTreeModel(root);
  11:     societies = new DefaultMutableTreeNode(ExperimentTree.SOCIETIES);
  12:         ...
  13:     tree.addMouseListener(mouseListener);
  14:     model.addTreeModelListener(myTreeModelListener);

View Full Code Here
   1: import javax.swing.tree.DefaultMutableTreeNode;
   2: import javax.swing.tree.DefaultTreeModel;
   3: import javax.swing.tree.TreePath;
   4:         ...
   5:       new DefaultMutableTreeNode(new CommunityTreeObject("Community"));
   6:     DefaultTreeModel treeModel = new DefaultTreeModel(root, true) {
   7:       public void valueForPathChanged(TreePath path, Object newValue) {
   8:         ...
   9:     treeModelListener = new CommunityTreeModelListener(communityTableUtils, experiment.getCommAsbID());
  10:     treeModel.addTreeModelListener(treeModelListener);
  11:     communityTree.setExpandsSelectedPaths(true);
  12:         ...
  13:     removeAllChildren(communityTree);
  14:     communityTree.getModel().addTreeModelListener(treeModelListener);

View Full Code Here
   1: import javax.swing.tree.DefaultMutableTreeNode;
   2: import javax.swing.tree.DefaultTreeModel;
   3: import javax.swing.tree.TreePath;
   4:         ...
   5:   private Object lockObject = new Object();
   6:   protected DefaultTreeModel model;
   7:   protected OrganizerTree workspace;
   8:         ...
   9:       root = new DefaultMutableTreeNode(null, true);
  10:       model = new DefaultTreeModel(root);
  11:     }
  12:         ...
  13:     if (doWorkspace)
  14:       model.addTreeModelListener(myModelListener);

View Full Code Here