This is already implemented:
I have a JTree in a JScrollPane.
I have a JCombobox, containing all the names of the nodes of the JTree.
When I select a node-name in the comboBox, the corresponding node in the
JTree is selected.
If the selected node is in the visible part of the scrollpane, I can see
that it is selected (the nodename becomes blue-coloured).
This is not implemented:
If the corresponding node is outside the visible part of the scrollpane,
I want to have it automatically be scrolled into the visible part of the
scrollpane.
Is there an easy way to do this?
Regards,
Hans
Vova Reznik - 13 May 2005 22:00 GMT
JComponent
scrollRectToVisible(Rectangle)
jonck@vanderkogel.net - 14 May 2005 11:35 GMT
If you can determine the path to the selected node, the easiest way to
do this is by calling:
scrollPathToVisible(TreePath)