I have JavaFX controls that can be associated with many, potentially conflicting values.
When the control is a TextField
, I use the promptText
property to put the string (Multiple conflicting values)
into the TextField
and use the trick described here to ensure the promptText
remains visible until the user types into the field. This works great.
Now, I would like to do the same thing with a ComboBox
, but I have discovered that a ComboBox
will display promptText
only if the editable
property is set to true
. This is a problem for me, because I do not want the user to type arbitrary strings into the ComboBox
. I want to limit him to a set of predetermined selections.
Is there a way to make ComboBox
display the promptText
even if its editable
property is set to false
? Extending ComboBox
is an acceptable solution in my case.