JavaFX ComboBox - Display text but return ID on selection
问题 I have a Database table with airports, each airport has a name and an ID. In JavaFX I have a form, with a ComboBox , the combobox needs to display all the airport names and when the form is submitted it needs to insert the ID of the airport into the database (not its name). But I'm not really figuring out what the solution is. I have a ObservableList vliegveldenList = FXCollections.observableArrayList(); ObservableList vliegveldenIDList = FXCollections.observableArrayList(); Database