How to convert Icon from JLabel into BufferedImage?
bufferedimage, image, java, jlabel, swing
Solution
To amplify on @Andrew Thompson's answer, note that an object that implements the `Icon` interface 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 the `paintIcon()` method. Here's a related example.
Problem
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.