I'm creating a javafx/fxml app. I have a dropdown that displays first name, last name and and ID. I want the dropdown to have the headers for each column and also display the data in that appropriate column. How would I go about creating this dropdown?
I have tried created a list view within the combo box and that didn't work properly. I have also tried to use the tableview and that I cannot also get to work appropriately.
You can set a cell factory to the ComboBox that creates the cells in the way you are looking for. However it will be tricky to implement the headers and scroll only the value cells.
To keep the things simple, I would rather go with a custom implementation that looks like a drop-down but built with some different nodes.
The general idea is:
TableView
in aPopup
that is placed at the bottom of the button.Please check the below demo. If this doesn't suite your needs, then I think you need to go with the cell factory implementation.