Buffered Image to ImageIcon

Hi all,
how can I turn a BufferedImage to an ImageIcon?

I have printed screen, within a certain area, and I want to apply that Bufferend Image to a JButton, but it would seem that I need to make it an ImageIcon.. how can I cast between them?

Thanks!
rubberdiAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
ImageIcon icon = new ImageIcon(bufferedImage);
0
 
rubberdiAuthor Commented:
Excellent, thanks alot CEHJ. :)
0
 
CEHJCommented:
8-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.