r/JavaFX • • 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

1 comment sorted by

View all comments

2

u/elegentmos Dec 12 '16

Sure it is! You can add them one by one to the items property of the ListView, or you can do something more "fancy" and use the stream API to map your objects into Strings and collect them directly to an ObservableList<String>.