• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ScrollBar won't budge!

 
Ranch Hand
Posts: 56
Tomcat Server Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic