Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Making a custom item in a Java FX ListView

+12 votes
We know how to make an item with a single string, so that each list view item looks like this: Item 1 Item 2 Item 3 but how would we make a custom entry in it, meaning how would we put a picture in the item, use different text styles styles for example?
asked Oct 3, 2015 in Fall 15-16 by Nick Caputo (100 points)

1 Answer

+3 votes
http://docs.oracle.com/javafx/2/ui_controls/list-view.htm

Example 11-4 shows cells with actual filled rectangle graphics in them, but it looks like the section where you create the cells that you populate the listview with can include multiple things, so you should be able to model it on that example but replace with the rectangle with however you would normally call up an image graphic. StackOverflow seems to suggest using a CustomListAdapter (or using the xml/css).
answered Oct 3, 2015 by Evan Henkel (100 points)
...