public static ImageIcon loadImageIcon ( final String iconName , final Class < ? > clazz ) { ImageIcon icon = null ; if ( iconName != null ) { final URL iconResource = clazz . getResource ( iconName ) ; if ( iconResource == null ) { LOGGER . error ( "Icon could not be loaded: '" + iconName ) ; icon = null ; } else { icon = new ImageIcon ( iconResource ) ; } } return icon ; }
Loads an image icon from a resource file .