binding - How to bind properties of two UI objects in Java? -
i have simple java application textfields , buttons. looking best , quick way bind state of 1 jtextfield state of 1 jbutton. i'm using eclipse, don't need tricks of netbeans ide.
suppose user needs input value textfield in order able send request. button should enabled if value of textfield not empty , consists @ least of 3 symbols. if user deletes input, button becomes disabled.
i come flex-world. such task can solved there easy. 1 should write this:
<mx:button enabled = "{mytextfield.text.length >= 3}" />
is there such opportunity in java? how called? hope, don't need write event listeners each pair of logicaly connected ui elements, i?
i documentlistener on jtextfield. every time document changes, check state of button, button.setenabled(textfield.gettext().length > 3)
Comments
Post a Comment