Can I use the same model with multiple JTree displaying different views of that model?

Sandip Chitale


TreeNode root = ...;
JTree tree1 = new JTree(root);
JTree tree2 = new JTree();

If you want to share the selection also you will have to share the TreeSelectionModel also along the similar lines.

You can also create your own model and use it with both trees.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact