• 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

I have a tableview page in my project where I need to control the scroll position dynamically

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a tableview page in my project where I need to control the scroll position dynamically. I tried to a lot and got the control of the table view to scroll, but the data is not changing when I change the scroll position.


==============================================================================
TableView tableView...

ScrollBar bar = getVerticalScrollbar(m_tableView);
bar.setValue(m_scrollpos);
bar.valueProperty().addListener(
new ChangeListener<Number>()
{
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
double value = newValue.doubleValue();
if(m_scrollpos > 0.0 && !isChanged){
isChanged = true;
}
else{
m_scrollpos = value;
}

ScrollBar bar = getVerticalScrollbar(m_tableView);
bar.setValue(m_scrollpos);
VirtualFlow vf = ((VirtualFlow)((TableViewSkin)m_tableVie w.getChildrenUnmodifiable().get(0)).getC hildrenUnmodifiable().get(1));
// System.out.println(vf.getFirstVisibleCel l().getIndex()+", "+vf.getLastVisibleCell().getIndex() );
m_index = vf.getLastVisibleCell().getIndex();
// m_tableView.scrollTo(m_index);

System.out.println(m_index);
}
});
======================================== ===================================
So the question is - How do I correctly handle the scroll position dynamically for my table, so that the data will change accordingly ?.
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic