Property wrapping an int value.
The value of an IntegerProperty can be get and set with get(),
getValue(), set(int), and setValue(Number).
A property can be bound and unbound unidirectional with
bind(ObservableValue) and unbind(). Bidirectional bindings
can be created and removed with bindBidirectional(Property) and
unbindBidirectional(Property).
The context of a IntegerProperty can be read with getBean()
and getName().
Note
setting or binding this property to a null value will set the property to "0.0". See setValue(java..
javafx.beans.value.ObservableIntegerValue , javafx.beans.value.WritableIntegerValue , ReadOnlyIntegerProperty, Property
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ObjectProperty | Returns: the newObjectPropertyOverrides javafx. Creates an |
| public void | bindBidirectional(Property<Number>
the other other)PropertyImplements javafx. Create a bidirectional binding between this |
| public static IntegerProperty | Returns: AIntegerProperty that wraps the
PropertyThe source property)PropertyReturns a |
| public void | setValue(Number
The new value v)Implements javafx. Set the wrapped value. |
| public String | Returns: a string representation of thisIntegerProperty object.Overrides javafx. Returns a string representation of this |
| public void | unbindBidirectional(Property<Number>
the other other)PropertyImplements javafx. Removes a bidirectional binding between this |
| IntegerProperty | back to summary |
|---|---|
| public IntegerProperty() Creates a default | |
| asObject | back to summary |
|---|---|
| public ObjectProperty Overrides javafx. Creates an Can be used for binding an ObjectProperty to IntegerProperty. IntegerProperty integerProperty = new SimpleIntegerProperty(1); ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2); objectProperty.bind(integerProperty.asObject());
| |
| bindBidirectional | back to summary |
|---|---|
| public void bindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Create a bidirectional binding between this It is possible to have multiple bidirectional bindings of one Property. JavaFX bidirectional binding implementation use weak listeners. This means bidirectional binding does not prevent properties from being garbage collected. | |
| integerProperty | back to summary |
|---|---|
| public static IntegerProperty integerProperty(final Property<Integer> property) Returns a This is very useful when bidirectionally binding an ObjectProperty<Integer> and a IntegerProperty. Another approach is to convert the IntegerProperty to ObjectProperty usingIntegerProperty integerProperty = new SimpleIntegerProperty(1); ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2); // Need to keep the reference as bidirectional binding uses weak references IntegerProperty objectAsInteger = IntegerProperty.integerProperty(objectProperty); integerProperty.bindBidirectional(objectAsInteger); asObject() method.Note null values in the source property will be interpreted as 0
| |
| setValue | back to summary |
|---|---|
| public void setValue(Number v) Implements javafx. Doc from javafx. Set the wrapped value. Note this method should accept null without throwing an exception, setting "0" instead. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides javafx. Returns a string representation of this | |
| unbindBidirectional | back to summary |
|---|---|
| public void unbindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Removes a bidirectional binding between this
| |