If necessary, UI components can be set to read only. This condition is required primarily for form components. In the read-only state, UI components are displayed with a light-gray background. When components are set to read-only, it is not possible to input entries, or select options and UI components. Unlike the disabled state, the read-only state allows the user to register events and execute button actions.
Set UI component to ReadOnly dynamically
button.setReadOnly(true); |
Remove ReadOnly state dynamically
button.setReadOnly(false); |