Simple, very straight forward but seems uncle google and me getting confused.
I have single JLabel that already has its own Icon.
How do I convert the Icon obtained from JLabel into a BufferedImage?
Is there any way around: I tried to multiple casting like this ..
final BufferedImage bf1 = (BufferedImage)((Image)jll_img.getIcon());
..but it failed.
To amplify on @Andrew Thompson’s answer, note that an object that implements the
Iconinterface knows how to paint something, but it may not have been asked to do so yet. In contrast, a BufferedImage has “an accessible buffer of image data” that your program must render by calling thepaintIcon()method. Here’s a related example.