@ Override protected void preparePaintComponent ( final Request request ) { super . preparePaintComponent ( request ) ; if ( ! this . isInitialised ( ) ) { List recent = loadRecentList ( ) ; if ( recent != null && ! recent . isEmpty ( ) ) { String selection = ( String ) recent . get ( 0 ) ; displaySelection ( selection ) ; } this . setInitialised ( true ) ; } updateTitle ( ) ; }
When the example picker starts up we want to display the last selection the user made in their previous session . We can do this because the list of recent selections is stored in a file on the file system .