Solved

Buffered Image to ImageIcon

Posted on 2004-10-03
3
1,189 Views
Last Modified: 2012-06-27
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!
0
Comment
Question by:rubberdi
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 20 total points
ID: 12210962
ImageIcon icon = new ImageIcon(bufferedImage);
0
 

Author Comment

by:rubberdi
ID: 12210979
Excellent, thanks alot CEHJ. :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12210984
8-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now