1
How can I pick up the selected item from a Combobox?
I saw some ways to do but I couldn’t implement, I don’t understand how it works.
I can set the items of the combobox as follows:
ObservableList<String> options
= FXCollections.observableArrayList(
"Ativo",
"Suspenso"
);
cbStatus.setItems(options);
just need to be able to catch them when I select them in the combobox.
Your question is incomplete... "I’ve tried some things" or saying "javafx is more boring than swing" doesn’t help much... BTW http://www.java2s.com/Code/JavaFX/SetandgetvalueforComboBox.htm or this http://www.java2s.com/Tutorials/Java/JavaFX/0590__JavaFX_ComboBox.htm to see if it helps...
– jsantos1991
I tried to use getValue but it didn’t work
– DiegoAugusto
Problem solved, I created a Mousecliked event and I can get the value inside that event. Thank you
– DiegoAugusto
Much better now your question, my +1... and I’m glad I got it.
– jsantos1991