Reputation: 5950
I have a combo box that has prompt text "Test".
Say I want to remove the prompt text in the list only like in the image below, how should I do it?
Thank you.
Upvotes: 0
Views: 1031
Reputation: 1
The simplest way to do this is with this line:
Some_ComboBox.getItems().remove(Some_ComboBox.getItems().size()-1);
Upvotes: 0
Reputation: 2600
I think the best way is to create your custom cellfactory and write a new ListCell class. Here you can add some logic: http://docs.oracle.com/javafx/2/api/javafx/scene/control/ListCell.html
Upvotes: 1
Reputation: 3367
I guess you can simply do this by using this method:
cbo.setPromptText(null);
Upvotes: 0