package com.ht.example; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.scene.Group; import javafx.scene.PerspectiveCamera; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.stage.Stage; public class ComboxTest extends Application { public static final String TITLE = "Combo Test"; public static void main(String[] args) { launch(args); } private Group group; @Override public void start(Stage stage) { stage.setTitle(TITLE); group = new Group(); ComboBox combox = new ComboBox(); Service> service = new Service>() { @Override protected Task> createTask() { return new Task>() { @Override protected ObservableList call() throws Exception { return FXCollections.observableArrayList("1", "2", "3"); } }; } }; combox.itemsProperty().bind(service.valueProperty()); group.getChildren().add(combox); final Scene scene = new Scene(group, 700, 625); scene.setCamera(new PerspectiveCamera()); stage.setScene(scene); stage.show(); service.start(); } }