This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I have an application in which I need to have one vertical JScrollBar mirror another when moved... (e.g. if I scroll the first scroll bar, the second will scroll the same amount and direction.). I have tried to set the scroll bars value but am unable to specify a value for the bar to start at (and yes, it is between the min and max). My first step is to be able to specify the starting value of a scroll bar ... say, setting it to the middle of the bar... any suggestions? Thanks in advance.
- Chris Stehno, SCPJ
Chris Stehno
Ranch Hand
Joined: Feb 26, 2001
Posts: 180
posted
0
An addendum to my earlier post ... I can get this to work with simple scroll bars but for some reason I cannot do it with scroll bars extracted from a JScrollPane ... any ideas?
Chris Stehno
Ranch Hand
Joined: Feb 26, 2001
Posts: 180
posted
0
I could really use some help with this one. Nothing I try works ... going through the JViewport and setting position, trying to set it on the JScrollBar ... nothing will allow the vertical scrollbar to be set. I have been able to set the horizontal, but that is only half my problem (and the solution to that part still does not do anything to the vertical). Please help, this is getting really frustrating!
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Chris, Is this what you are trying to do?
Enjoy, Manfred.
Chris Stehno
Ranch Hand
Joined: Feb 26, 2001
Posts: 180
posted
0
Close ... I want to do something similar with a JScrollPane (or the scrollbars in a JScrollPane). I was able figured out how to do it with normal scroll bars, but I cannot get it to work with scroll bars from a scroll pane. What I need is the opposite of your example, basically ... I need the scroll bar to control the scrollbar in the scroll pane. [This message has been edited by Chris Stehno (edited July 24, 2001).]
Chris Stehno
Ranch Hand
Joined: Feb 26, 2001
Posts: 180
posted
0
Well I'll be damned! Something you showed me made it work ... I guess I just had the wrong approach. Thanks!
Josh Rehman
Ranch Hand
Joined: Jul 24, 2001
Posts: 63
posted
0
I just wished to share that I like the style of your code, Manfred.
Originally posted by Manfred Leonhardt: [B]Hi Chris, Is this what you are trying to do?