What about to add ebableProperty() on Node class ?
Sebastian Rheinnecker
sebastian.rheinnecker at yworks.com
Mon Jul 30 08:12:34 PDT 2012
Hello Tadashi,
The property "disable" on Node is probably what you are looking for.
Your example could be written like this:
Button button = new Button("Button");
CheckBox check = new CheckBox("selectable");
button.disableProperty().bind( check.selectedProperty().not() );
kind regards,
Sebastian Rheinnecker
Am 30.07.2012 17:03, schrieb Tadashi Ohmura:
> Hellow everyone.
>
> What about to add "enableProperty()" on Node class ?
>
> Just write in the following way if Node has "enableProperty()"
>
> Button button = new Button("Button");
> CheckBox check = new CheckBox("selectable");
> button.enableProperty().bind( check.selectedProperty() );
>
> insread of
>
> final Button button = new Button("Button");
> CheckBox check = new CheckBox("selectable");
> check.selectedProperty().addListener( new ChangeListener<Boolean>(){
> public void changed( ObservableValue<? extends Boolean> value, Boolean
> oldVal, Boolean newVal ) {
> if( newVal==false ) button.setDisable(true);
> else button.setDisable(false);
> }
> });
>
> Best regards
>
> Tadashi Ohmura
>
>
>
--
Sebastian Rheinnecker
phone: +49 7071 9709050
fax: +49 7071 9709051
yWorks GmbH
Vor dem Kreuzberg 28
72070 Tuebingen
Germany
http://www.yworks.com
Managing Directors: Sebastian Müller, Michael Pfahler
Commercial Registry: Stuttgart, Germany, HRB 382340
More information about the openjfx-dev
mailing list