public void setImage ( Resource resource ) { ImageIcon image = null ; if ( resource != null && resource . exists ( ) ) { try { image = new ImageIcon ( resource . getURL ( ) ) ; } catch ( IOException e ) { logger . warn ( "Error reading resource: " + resource ) ; throw new RuntimeException ( "Error reading resource " + resource , e ) ; } } setImage ( image ) ; }
Sets the image content of the widget based on a resource