BugLighter
asked on
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?
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?
ASKER
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?
say I have an icon.GIF file how do i set it as a frame icon?
Image image = toolkit.getDefaultToolkit( ).getImage (String gifFilename);
// or
// Image image = toolkit.getDefaultToolkit( ).getImage (URL gifURL);
frame.setIconImage(image);
// or
// Image image = toolkit.getDefaultToolkit(
frame.setIconImage(image);
ASKER
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?
say I have an icon.GIF file how do i set it as a frame icon?
ASKER
hey_hey,
I have found it already,
but thanks for the rapid help..:-)
post an answer and I'll give you the points.
BugLighter.
I have found it already,
but thanks for the rapid help..:-)
post an answer and I'll give you the points.
BugLighter.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
May I use it with *.bmp files also?
should I give the full path "c:\icon.BMP"?
should I give the full path "c:\icon.BMP"?
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)
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