@ Override public void preparePaintComponent ( final Request request ) { if ( ! this . isInitialised ( ) || resetButton . isPressed ( ) ) { String preferredState = request . getAppPreferenceParameter ( "example.preferred.state" ) ; stateSelector . setSelected ( preferredState ) ; this . setInitialised ( true ) ; } }
Override preparePaintComponent to set the initial selection from the app preferences . The selection is set the first time the example is accessed or when the reset button is used .