Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4244067

Wrong Transparent Color Replacement for Window Icons

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • client-libs
    • 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)
      ======================================================================

            son Oleg Sukhodolsky (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: