I am creating a scrollpane which display sets of data which is fetched from a sqlite db and these data are display in such a way that they arranged in repeated set of ui like in recyclerview in android. Is there any way to achieve it because its not easy to position elements using javafx
There are a few classes that work with similar concepts in javafx:
The adapter is replaced by the cellFactory
(s), position does not really have an equivalent, the cells do contain a index
property though. There is a updateItem
method in the Cell
class that is responsible for updating the cell visuals.
Please use some tutorials to become familiar with those kind of controls, since this is beyond the scope of an answer.
ListCell
works similar to TableView
, but there is basically just a single column, and the cellFactory
is a property of the ListView
class itself and there is no cellValueFactory
equivalent.
TreeView
and TreeTableView
work pretty similar to ListView
and TableView
respecively, the main difference being the support of a hierarchical data structure.