• Post Reply Bookmark Topic Watch Topic
  • New Topic

ScrollBar won't budge!

 
Michael Labuschagne
Ranch Hand
Posts: 56
Java Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the example below I get the horizontal scroll bar position from one jscrollpane and then set it is as the scroll bar position for another jscrollpane (both scrollpanes have the same maximum value of 150) but when ever the value is greater than 90 setting it past that value has no effect.

Any ideas?

Thanks!

 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Labuschagne:
I get the horizontal scroll bar position from one jscrollpane and then set it is as the scroll bar position for another jscrollpane (both scrollpanes have the same maximum value of 150) but when ever the value is greater than 90 setting it past that value has no effect.


It's hard to know without more details, but if I had to guess I'd say it had something to do with the scroll bars' extents.

btw, if what you are trying to do is get returnModel's and lookupModel's scroll panes to scroll horizontally together, then the easiest way to do it is like this:



Note that you would only do this once, as opposed to in a listener or something like that.
 
Michael Labuschagne
Ranch Hand
Posts: 56
Java Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting code I'll def. hang on to it.

Here's some additional code, if it makes any sense. What I'm interested in is:


The code above saves the current position of the jscrollbar before it is refreshed with a new JTable.

Then:



The code above sets the position of the new scrollbar.

Here is all the code:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!