public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; spinner . setEnabled ( enabled ) ; textField . setEnabled ( enabled ) ; /* * Fixes the background bug * 4991597 and sets the background explicitely to a * TextField.inactiveBackground. */ if ( ! enabled ) { textField . setBackground ( UIManager . getColor ( "TextField.inactiveBackground" ) ) ; } }
Enable or disable the JSpinField .