I am bind the value of number of items left in the factory.
private int item;
private SimpleIntegerProperty itemProperty = new SimpleIntegerProperty();
private SimpleIntegerProperty remainingItem = new Simple IntegerProperty();
private SimpleIntegerProperty soldItem = new Simple IntegerProperty();
in the constructor
this.item = item;
itemProperty.set(item);
soldItem.set(0);
remainingItem.bind(soldItem.subtract(item).multiply(-1));
//itemProperty.bind((soldItem.subtract(item).multiply(-1));
In the fxml file
<Text text="${controller.factory.remainingProperty.get()}">
when I try to bind itemProperty it give invalid when I try to display with remainingProperty ReadOnlyIntegerProperty with get method,it throws EXCEPTION in the main class.
I am trying to subtract the number of item from item and display it.