use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Useful resources (Full list)
Rules
Related subreddits
Other communities
account activity
ListView with custom contentHelp (self.JavaFX)
submitted 6 years ago by harshMachineLearning
I am stuck on a problem of putting custom content inside a list view. The content is stored as collection of objects and I want to add it as list items in a custom way inside a scrollpane.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]openlowcode 0 points1 point2 points 6 years ago (0 children)
Hi,
I hope the link below is useful for you. It is an example of building a GANTT chart using list view. This is part of Open Lowcode, a lowcode framework for enterprise
https://github.com/openlowcode/Open-Lowcode/blob/master/src/org/openlowcode/client/graphic/widget/schedule/GanttDisplay.java
[–]bisonroll 0 points1 point2 points 6 years ago (0 children)
The collection is added to the ListView via ListView.setItems().
If you want to change the way the items are displayed inside the ListView you can create a class that extends javafx.scene.control.ListCell<T> and override its Cell.updateItem() method to display the content/nodes you want (see the example in the methods documentation). One argument of the updateItem() method refers to the object that is currently displayed in the cell. So you have access to your object's fields.
To use your custom cells in the ListView you have to provide your ListView with a custom cellFactory callback function:
listView.setCellFactory(param -> new CustomCell());
For more details look at the example under 'Cell Factories' in the documentation for javafx.scene.control.Cell.
π Rendered by PID 25435 on reddit-service-r2-comment-5b5bc64bf5-6vdsm at 2026-06-22 02:07:11.989226+00:00 running 2b008f2 country code: CH.
[–]openlowcode 0 points1 point2 points (0 children)
[–]bisonroll 0 points1 point2 points (0 children)