ICONS and windows

Using sdk2, swing.

How can I overide java's icon with  an incon ( ico file ) on a window (JFrame, JDialog).

Is *.ico file are standard icon files for non-microsoft platforms?
BugLighterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

heyhey_Commented:
1. convert .ico to .gif

2. use
- Class Frame -
public void setIconImage(Image image)
Sets the image to displayed in the minimized icon for this frame. Not all platforms support the concept of minimizing a window.

as far as I remember Dialogs use their parent Frame Image
0
BugLighterAuthor Commented:
I did not understand how to use the setIconImage method
say I have an icon.GIF file how do i set it as a frame icon?
0
heyhey_Commented:
Image image = toolkit.getDefaultToolkit().getImage(String gifFilename);

// or
// Image image = toolkit.getDefaultToolkit().getImage(URL gifURL);

frame.setIconImage(image);
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

BugLighterAuthor Commented:
I did not understand how to use the setIconImage method
say I have an icon.GIF file how do i set it as a frame icon?
0
BugLighterAuthor Commented:
hey_hey,
I have found it already,
but thanks for the rapid help..:-)

post an answer and I'll give you the points.

BugLighter.
0
heyhey_Commented:
Thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BugLighterAuthor Commented:
May I use it with *.bmp files also?
should I give the full path "c:\icon.BMP"?

0
heyhey_Commented:
you can't use .bmp files directly from Java. you should convert it to .gif (or .jpg) ro implement your own BMPImageLoader (there is nice article at www.javasoft.com)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Graphics Software

From novice to tech pro — start learning today.