Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Make a tree node visible

Posted on 2001-09-04
3
Medium Priority
?
595 Views
Last Modified: 2006-11-17
I have a JTree in a scroll pane.
I want that after every change selection (not only the mouse, but also using the keyboard), the selected node will be seen.
I've added a listener to catch the change selection events and in the event i call to scrollPathToVisible method.
It simply doesn't work.
Can you tell me why?
0
Comment
Question by:rzvika
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 6453290
> It simply doesn't work.

post a small compilable example that reproduces the problem
0
 
LVL 16

Expert Comment

by:Valeri
ID: 6453452
Hi Rzvika,

I have heard for it :
It's Swing bug, which is reported on Sun web site. There is workaround for it. Just call the function twice :

scrollTreePathToVisible(tree, path);
scrollTreePathToVisible(tree, path);

Best regards,
Valeri
0
 
LVL 16

Accepted Solution

by:
Valeri earned 150 total points
ID: 6453543
Sorry, call the function twice :

tree.scrollPathToVisible(treePath);
tree.scrollPathToVisible(treePath);

You can use makeVisible(path) as well... What do you exactly want ?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question