Converting Integer to ObservableValue<Integer> in javafx

We use a ReadOnlyObjectWrapper<>(*integer value*); and store the value in a ObservableValue<Integer> reference.

ObservableValue<Integer> obsInt = new ReadOnlyObjectWrapper<>(intValue);

Update

Starting JavaFX 8, you can also do the following :

ObservableValue<Integer> obsInt = new SimpleIntegerProperty(intValue).asObject();

Another way.

new SimpleIntegerProperty(integer_value).asObject()

if you use tableview do this : just change Integer to Number

@FXML
private TableColumn<Sockets,Number> key;
...
key.setCellValueFactory(cellData -> cellData.getValue().socketIdProperty());