A corner case in JTree behaviour: One of my test applications does the following to ensure that the tree node selected by the user becomes visible:
... TreePath treepath = new TreePath( node.getPath() ); fileListTree.setSelectionPath( treepath ); fileListTree.scrollPathToVisible( treepath ); fileListTree.expandPath( treepath ); // FIXME: required? When the selected subtree has more leaf nodes than fit on screen, classpath (cvs 2006.10.19) scrolls the tree to show the path from root-node to selected subtree, but the currently selected leaf node might become invisible. The JDK scrolls the tree to always show the selected leaf node, which is better. Note that the above code might be questionable, because the call to expandPath() after scrollPathToVisible() is redundant. I probably added it to get an earlier version of classpath or the JDK (1.3.x?) to work... -- Summary: JTree.scrollPathToVisible/expandPath buglet Product: classpath Version: 0.93 Status: UNCONFIRMED Severity: normal Priority: P3 Component: swing AssignedTo: roman at kennke dot org ReportedBy: hendrich at informatik dot uni-hamburg dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29513 _______________________________________________ Bug-classpath mailing list Bug-classpath@gnu.org http://lists.gnu.org/mailman/listinfo/bug-classpath