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

SystemColor.get[Red,Green,Blue] return bad value

XMLWordPrintable

    • 1.2beta4
    • generic, x86
    • generic, windows_95, windows_nt
    • Not verified

      In JDK1.2, SystemColor.control was wrong color.
      I get nearly black.

      This is a test program. Why does this program get
      differnt value of Red,Green and Bule in JDK1.2.

      import java.awt.*;

      public class TestSystemColor extends Frame {
        Button b1;
        Panel panelhs;

        public TestSystemColor() {
          super("TestSystemColor");
          setSize(640, 480);

          Color syc = SystemColor.control;
          
          setBackground(SystemColor.control);

          System.out.println(" sycRGB=" + syc.getRGB());
          System.out.println(" sysR =" + syc.getRed());
          System.out.println(" sys G =" + syc.getGreen());
          System.out.println(" sys B=" + syc.getBlue());

          Color rcsyc = new Color(syc.getRGB());
          System.out.println("rcsycRGB=" + rcsyc.getRGB());
          System.out.println("rcsysR =" + rcsyc.getRed());
          System.out.println("rcsys G =" + rcsyc.getGreen());
          System.out.println("rcsys B=" + rcsyc.getBlue());

          show();
        }

        public static void main(String[] args) {
          new TestSystemColor();
        }

      }

            xdengsunw Xianfa Deng (Inactive)
            ggrahamsunw Gregory Graham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: