Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to do arthimetic operations on Observable value and DoubleProperty?

812390Jun 17 2011 — edited Jun 17 2011
I have one variable :
public ObservableValue<Double> postionX;
public ObservableValue<Double> positionY;

postionX = (ObservableValue)myscene.widthProperty();
postionX = (ObservableValue)myscene.heightProperty();


ScrollPane sp = new ScrollPane();

       
         sp.preWidthProperty().bind(DoubleProperty)positionX.getValue()-300);
         sp.prefHeightProperty().bind((DoubleProperty)postionY.getValue()-50);
it is not casting to doubleproperty and same problem for observableValues as well.
how to cast , or perform arthimetic operations on these data types? is there any other way ?

Edited by: Bava on Jun 17, 2011 5:50 AM
This post has been answered by Narayan on Jun 17 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2011
Added on Jun 17 2011
3 comments
198 views