Package examples

Class ActionExample3


  • public class ActionExample3
    extends Application
    The enabledProperty @Action annotation parameter.

    This example is nearly identical to ActionExample1. We've added a parameter to the @Action annotation for the clearTitle action:

     @Action(enabledProperty = "clearEnabled")
     public void clearTitle() { 
         appFrame.setTitle(textField.getText());
         setClearEnabled(true);
     }
     
    The annotation parameter names a bound property from the same class. When the clearEnabled property is set to false, as it is after the window's title has been cleared, the clearTitle Action is disabled.