/** * Returns the icon for the specified input stream. * * @param inputStream * Icon input stream. * @param initialDim * Initial dimension of the icon. * @return Icon instance. */ public static IcoWrapperResizableIcon getIcon(InputStream inputStream, final Dimension initialDim) { return new IcoWrapperResizableIcon(inputStream, initialDim); }
@Override public void setDimension(Dimension dim) { this.setPreferredSize(dim); } }
/** * Returns the icon for the specified URL. * * @param location * Icon URL. * @param initialDim * Initial dimension of the icon. * @return Icon instance. */ public static IcoWrapperResizableIcon getIcon(URL location, final Dimension initialDim) { try { return new IcoWrapperResizableIcon(location.openStream(), initialDim); } catch (IOException ioe) { ioe.printStackTrace(); return null; } }