Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Automatically scroll to selected node in JTree

Thread view: 
Hans-Henning.Gabriel - 13 May 2005 20:12 GMT
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)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.