Image image = GenerateImage.toImage(true); //this generates an image file
JLabel thumb = new JLabel();
thumb.setIcon(image)
Image image = GenerateImage.toImage(true); //this generates an image file JLabel thumb = new JLabel();
Share
You have to supply to the JLabel an
Iconimplementation (i.eImageIcon). You can do it trough thesetIconmethod, as in your question, or through theJLabelconstructor:I recommend you to read the Javadoc for
JLabel,Icon, andImageIcon. Also, you can check the How to Use Labels Tutorial, for more information.