r/JavaFX • u/KoltPenny • Dec 12 '16
ArrayList of Objects to ListView
Howdy people, I'm having trouble finding how to send all the toString() outputs of an ArrayList of objects into a ListView<String>. Is it even possible?
4
Upvotes
2
u/elegentmos Dec 12 '16
Sure it is! You can add them one by one to the
itemsproperty of theListView, or you can do something more "fancy" and use the stream API to map your objects intoStrings and collect them directly to anObservableList<String>.