/** * Creates a thumbnail from the supplied component (such as a chart). If you want to display the thumbnail as a * component you can pass the created ImageIcon as a parameter to the constructor of a JLabel. * * @param component the component from which we would like to generate a thumbnail * @param width the width of the thumbnail * @param height the height of the thumbnail * @return an ImageIcon of the supplied component */ public static ImageIcon createThumbnail(Component component, int width, int height) { return new ImageIcon(createThumbnailImage(component, width, height)); }