-
February 9th, 2016, 08:25 AM
#1
JavaFx 8 Slider
I need a help about taking 2 sliders value and pass it to a function in order to calculate BMI
For ex:
height.valueProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> ov,
Number old_val, Number new_val2) {
// System.out.println(new_val.doubleValue());
heightValue.setText(String.format("%.2f", new_val2));
}
});
weight.valueProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> ov,
Number old_val, Number new_val) {
// System.out.println(new_val.doubleValue());
weightValue.setText(String.format("%.2f", new_val));
}
});
I try to pass these new_val2 and new_val to the function
public double calculateBMI(double a,double b)
Thanx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|