I want to populate my ComboBox (Jfoenix combo box) when User Click on Combobox to open it.
I linked On Context Menu Requested and On Mouse Clicked methods from SceneBuilder to method below but I checked with debugger and this method is not even invoked when I click on combo box. What should I do to dynamically populate combo box when user click on it to open?
I searched for this and actually didn't find the answer. But it is likely that a similar question exists on StackOverflow. So If you find it, Link to it and I will delete my question.
public void populateComboBox() { //It is linked to OnContextMenuRequested
//and OnMouseClicked
ArrayList<String> deckNames = new ArrayList<>();
ArrayList<Deck> decks = Account.getLoginedAccount().getCardCollection().getDecks();
for (int i = 0; i < decks.size(); i++) {
if (decks.get(i) != null) {
deckNames.add(decks.get(i).getDeckName());
}
}
listOfDecks_cb.getItems().clear();
listOfDecks_cb.getItems().addAll(deckNames);
}