public static Icon getStockIcon ( String name ) { SoftReference < Icon > ref = iconcache . get ( name ) ; if ( ref != null ) { Icon icon = ref . get ( ) ; if ( icon != null ) { return icon ; } } java . net . URL imgURL = StockIcon . class . getResource ( name + ".png" ) ; if ( imgURL != null ) { Icon icon = new ImageIcon ( imgURL ) ; iconcache . put ( name , new SoftReference <> ( icon ) ) ; return icon ; } LoggingUtil . warning ( "Could not find stock icon: " + name ) ; return null ; }
Get a particular stock icon .