Velocity Reviews

Velocity Reviews (
-   Java (
-   -   Testing JTree setSelectionPath(TreePath path)? ( 01-03-2005 03:40 AM

Testing JTree setSelectionPath(TreePath path)?
How can I tell if a call to JTree setSelectionPath(TreePath path) fails
because of an invalid path? I have a search function set up which
stores TreePaths. While browsing the TreePaths I choose one or more
and when I do, I expand the chosen TreePath (using setSelectionPath())
and select the TreeNode. This works great. Now, if the structure of
the tree changes, I want to be able to know that my attempt at
setSelectionPath() didn't work. I thought that perhaps getting the
selected object after calling setSelectionPath() and testing for null
would work, but instead it returns what seems to be the object at the
bottom of the TreePath I attempted to use to set the selection in the
first place.

Any ideas? Is there a path validation function I'm overlooking?

-Carl Gundel, author of Liberty BASIC

Andrew Thompson 01-03-2005 04:02 AM

Re: Testing JTree setSelectionPath(TreePath path)?
On 2 Jan 2005 19:40:35 -0800, wrote:

> How can I tell if a call to JTree ...

GUI experts are best found at..

Andrew Thompson Web & IT Help Open-source software suite Science & Technology Images that escape the mundane

All times are GMT. The time now is 02:48 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.