aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Slider usage with a Tree Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Slider usage with a Tree" Watch "Slider usage with a Tree" New topic
Author

Slider usage with a Tree

Swati Udas
Ranch Hand

Joined: Aug 18, 2004
Posts: 121
I am trying to have a Tree in an expanbarwidget. User should be able to scroll through the tree elements using a slider.
I wrote following code for the same



Whlie debuggin I put a breakpoint inside slider-listener.
Message says- "tree" cannot be resolved.
However if I try this on a text box instead of tree everything works fine.
Any suggestions ?
Thanks for reading my question .


SCJP 1.4 (90%)<br />SCWCD 1.4 (88%)
Swati Udas
Ranch Hand

Joined: Aug 18, 2004
Posts: 121
Hi Its working now ..just shifted some code outside the listener.

<Control[] children= tree.getChildren(); int count=children.length;
int newSel=count*slide.getSelection()/100;>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Slider usage with a Tree
 
Similar Threads
how to make the border of tree widget invisible
Problem with JTree inside JScrollPane inside JPanel
JTree image node
Sample code to drag drop buttons in Applet
java SWT application giving error while executing jar file