Java Code Examples for javafx.beans.property.SimpleIntegerProperty#set()

The following examples show how to use javafx.beans.property.SimpleIntegerProperty#set() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainSceneController.java    From JavaFX-Tutorial-Codes with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(URL url, ResourceBundle rb) {
    SimpleIntegerProperty a = new SimpleIntegerProperty(5);
    SimpleIntegerProperty b = new SimpleIntegerProperty(10);
    NumberBinding sum = a.add(b);
    System.out.println(sum.getValue());
    a.set(20);
    System.out.println(sum.getValue());

    textField.textProperty().bind(stringProperty);
    MyTask myTask = new MyTask();
    textField.setOnMouseClicked(event -> {
        Timer timer = new Timer(true);
        timer.scheduleAtFixedRate(myTask, 0, 1 * 1000);
    });

    tf1.textProperty().bindBidirectional(tf2.textProperty());
}
 
Example 2
Source File: MainSceneController.java    From JavaFX-Tutorial-Codes with Apache License 2.0 5 votes vote down vote up
private void sumObservable() {
    SimpleIntegerProperty a = new SimpleIntegerProperty(10);
    SimpleIntegerProperty b = new SimpleIntegerProperty(10);
    NumberBinding sum = a.add(b);
    System.out.println(sum.getValue());
    a.set(20);
    System.out.println(sum.getValue());
}
 
Example 3
Source File: ProgressModel.java    From VocabHunter with Apache License 2.0 4 votes vote down vote up
private void updateValue(final SimpleIntegerProperty property, final int delta) {
    property.set(property.get() + delta);
}