Skip to content
Advertisement

Array to ComboBox – JavaFx

I am working on a school project, I am trying to bring an a String array straight into a combo box and am getting an error.

Error: java: incompatible types: java.lang.String[] cannot be converted to javafx.collections.ObservableList<java.lang.String>

JavaScript

Advertisement

Answer

That ComBoBox constructor needs an ObservableList as argument . if you want to add an array of Strings use addAll() method

JavaScript
Advertisement