I have a jtree which is set to TreeSelectionModel.SINGLE_TREE_SELECTION. But, I also have a search facility which might result in two nodes having same id to be shown to user. How can I achieve this? Below is code snippet of what I have done , which is not working. //When multiple values are found....change the selection mode.. jtree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); jtree.setSelectionPaths(treepath); jtree.scrollPathToVisible(treepath); jtree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
posted 13 years ago
Any thoughts on this? I am still not able to figure this out. Thanks.