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

SystemColor static variables incorrectly initialized under win32 (1.1.x ONLY)

    XMLWordPrintable

Details

    • x86, sparc
    • solaris_2.5, windows_nt

    Description



      Name: saC57035 Date: 04/27/99



      System colors are incorrectly initialized under win32.
      High byte is initialized to 0x00 while spec says:

            Gets the "current" RGB value representing the symbolic color.
            (Bits 24-31 are 0xff, 16-23 are red, 8-15 are green, 0-7 are blue).
             ^^^^^^^^^^^^^^^^^^^
      ------------ Test.java
      import java.awt.*;

      public class Test {
        public static void main(String [] args) {
          if((SystemColor.desktop.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("desctop "+(SystemColor.desktop.getRGB() & 0xFF000000));
          }
          if((SystemColor.activeCaption.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("activeCaption "+(SystemColor.activeCaption.getRGB() & 0xFF000000));
          }
          if((SystemColor.activeCaptionText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("activeCaptionText "+(SystemColor.activeCaptionText.getRGB() & 0xFF000000));
          }
          if((SystemColor.activeCaptionBorder.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("activeCaptionBorder "+(SystemColor.activeCaptionBorder.getRGB() & 0xFF000000));
          }
          if((SystemColor.inactiveCaption.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("inactiveCaption "+(SystemColor.inactiveCaption.getRGB() & 0xFF000000));
          }
          if((SystemColor.inactiveCaptionText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("inactiveCaptionText "+(SystemColor.inactiveCaptionText.getRGB() & 0xFF000000));
          }
          if((SystemColor.inactiveCaptionBorder.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("inactiveCaptionBorder "+(SystemColor.inactiveCaptionBorder.getRGB() & 0xFF000000));
          }
          if((SystemColor.window.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("window "+(SystemColor.window.getRGB() & 0xFF000000));
          }
          if((SystemColor.windowBorder.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("windowBorder "+(SystemColor.windowBorder.getRGB() & 0xFF000000));
          }
          if((SystemColor.windowText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("windowText "+(SystemColor.windowText.getRGB() & 0xFF000000));
          }
          if((SystemColor.menu.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("menu "+(SystemColor.menu.getRGB() & 0xFF000000));
          }
          if((SystemColor.menuText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("menuText "+(SystemColor.menuText.getRGB() & 0xFF000000));
          }
          if((SystemColor.text.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("text "+(SystemColor.text.getRGB() & 0xFF000000));
          }
          if((SystemColor.textText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("textText "+(SystemColor.textText.getRGB() & 0xFF000000));
          }
          if((SystemColor.textHighlight.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("textHighlight "+(SystemColor.textHighlight.getRGB() & 0xFF000000));
          }
          if((SystemColor.textHighlightText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("textHighlightText "+(SystemColor.textHighlightText.getRGB() & 0xFF000000));
          }
          if((SystemColor.textInactiveText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("textInactiveText "+(SystemColor.textInactiveText.getRGB() & 0xFF000000));
          }
          if((SystemColor.control.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("control "+(SystemColor.control.getRGB() & 0xFF000000));
          }
          if((SystemColor.controlText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("controlText "+(SystemColor.controlText.getRGB() & 0xFF000000));
          }
          if((SystemColor.controlHighlight.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("controlHighlight "+(SystemColor.controlHighlight.getRGB() & 0xFF000000));
          }
          if((SystemColor.controlLtHighlight.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("controlLtHighlight "+(SystemColor.controlLtHighlight.getRGB() & 0xFF000000));
          }
          if((SystemColor.controlShadow.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("controlShadow "+(SystemColor.controlShadow.getRGB() & 0xFF000000));
          }
          if((SystemColor.controlDkShadow.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("controlDkShadow "+(SystemColor.controlDkShadow.getRGB() & 0xFF000000));
          }
          if((SystemColor.scrollbar.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("scrollbar "+(SystemColor.scrollbar.getRGB() & 0xFF000000));
          }
          if((SystemColor.info.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("info "+(SystemColor.info.getRGB() & 0xFF000000));
          }
          if((SystemColor.infoText.getRGB() & 0xFF000000) != 0xFF000000) {
              System.out.println("infoText "+(SystemColor.infoText.getRGB() & 0xFF000000));
          }
        }
      }
      ------------ Output under jdk1.1.8 win32
      desctop 0
      activeCaption 0
      activeCaptionText 0
      activeCaptionBorder 0
      inactiveCaption 0
      inactiveCaptionText 0
      inactiveCaptionBorder 0
      window 0
      windowBorder 0
      windowText 0
      menu 0
      menuText 0
      text 0
      textText 0
      textHighlight 0
      textHighlightText 0
      textInactiveText 0
      control 0
      controlText 0
      controlHighlight 0
      controlLtHighlight 0
      controlShadow 0
      controlDkShadow 0
      scrollbar 0
      info 0
      infoText 0
      ------------

      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              ehawkessunw Eric Hawkes (Inactive)
              savzan Stanislav Avzan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: