-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.2
-
x86
-
windows_nt
Name: skT88420 Date: 06/04/99
When you set a frame's window icon to a GIF that has
a transparent background on Windows NT 4.0 SP4, the
transparent portion of the image is set to black rather
than the color that the window's title bar is.
This problem has cropped up with all versions of JDK 1.2,
however, I have not noticed this problem at all in
the JDK 1.1.x platform.
This problem occurs with both 32x32 and 16x16 GIFs.
Below is a TestCase you can try.
Make sure that the image cloud-icon.gif is in the
same directory that you are running this code from.
I have posted the cloud-icon.gif file to my Web site
at http://www.dippybird.com/cloud-icon.gif
import java.awt.*;
import javax.swing.*;
public class TestFrame extends Frame {
public TestFrame() {
ImageIcon imageIcon;
Image image;
try{
imageIcon = new ImageIcon(getClass().getResource("cloud-icon.gif"));
image = imageIcon.getImage();
this.setIconImage(image);
}catch (Exception e){
System.out.println("Problem finding cloud icon");
}
this.add(new Label("Notice that the transparent background "+
"color for this window's icon is black rather than the title bar color."));
this.pack();
}
public static void main(String[] args) {
new TestFrame().show();
}
}
(Review ID: 83951)
======================================================================
- duplicates
-
JDK-4175560 setIconImage no longer handles transparent GIFs
- Resolved