User Brent ( posted:

Hi All,

I ran into a minor problem. Wondering if anyone else has dealt with this.
I searched the archives but nothing turned up.

If a JavaTree MakeSelection is used to select/highlight a tree node that
is currently outside of the tree view's viewport (but could be within the
viewport if the scrollbar was adjusted), the nearest visible node is
selected/highlighted instead. For example, if the script wanted to select
the topmost node in a fully expanded tree but that node is currently not
visible to the user because it has been scrolled beyond the upper edge of
the tree view viewport, the uppermost visible node will be
selected/highlighted instead of the target node.

A hypothetical workaround for this could be to first check whether a node
is currently exposed to the user thru the viewport. If not, then scroll
the tree until the target node is exposed.

But there doesn't seem to be a direct way of determining whether a
particular node is currently exposed. I suppose I could just do the
JavaTree MakeSelection. Then test whether the resultant selected node is
the same as the target node. If not, just scroll and do another JavaTree