Chromos
Chromos

Reputation: 1921

JavaFX Scrollbar sometimes doesn't show up in TableView

My application is loading external data into an observablist and then into a TableView. The scrollbar has some strange behaviour there. Most of the time it shows up but sometimes it doesn't. When I load it a few times it shows up and I can scroll the list. I have one column of images don't know if this causes trouble. The window size seems in no relation to this problem.

This is the code:

for (int i = 0; i < listOfProducts.getLength(); i++){
    xmlData.add(
        new Products(img.get(i), formatList.get(i),
            titleList.get(i), 
            pubList.get(i), pageList.get(i), publisherList.get(i), 
            heightList.get(i)));
}

productTable.setItems(xmlData);

Upvotes: 0

Views: 1042

Answers (2)

Uluk Biy
Uluk Biy

Reputation: 49215

The problem may be occurred because of the tableview internal listeners (which listen the observable list items changes) are not triggered by productTable.setItems(). To trigger them try

productTable.getItems().addAll(xmlData);

Upvotes: 1

Sergey Grinev
Sergey Grinev

Reputation: 34528

It looks like an issue http://javafx-jira.kenai.com/browse/RT-11873

but it was fixed way ago. Which version of JavaFX do you have?

Upvotes: 0

Related Questions