Oracle Community Directory
Oracle Community FAQ
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
JavaFX 2.0 and Later
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Nov 23, 2012 6:32 AM by
Binding TextField to a Java Class Variable
Nov 23, 2012 5:45 AM
Although this seems easy, I am having trouble doing this. I am trying to bind a Textfield to a Java 'String' Variable. I do not know how to go about this.
I did try Bindings.biDirectional( txtFieldProperty() , stringProperty() )
But the parameters in the method are 'StringProperty' typewhereas I want to bind the Textfield to a String Variable.
How do I go about this?
This content has been marked as final.
Show 1 reply
Re: Binding TextField to a Java Class Variable
Nov 23, 2012 6:32 AM
in response to
StringProperty is a wrapper around a String: http://docs.oracle.com/javafx/2/api/javafx/beans/property/StringProperty.html
You need to update the StringProperty instead of updating just the String:
so instead of
string = "Update";