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

Cannot allocate many colors/graphics calls

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • None
    • 1.1.1
    • client-libs
    • None
    • x86
    • windows_nt

    Description



      Name: mc57594 Date: 05/22/97


      import java.awt.*;
      import java.applet.*;

      /*
      Here is some sorce code which re-produces the problem.
      I have tried this on Solaris with 1.1 and it dosn't exibit the
      problem. I have also tried it with 1.0.2 in Linux and I don't
      see it. It seems to be only Win32. I tried a 32-bit and a
      16 bit video driver and in both cases, the program stops
      drawing after about 1/4 - 1/3 of the frame is filled.
      */

      /*
        <applet code=test.class width = 255 height = 255>
        </applet>
        */

      public class test extends Applet {
        int total = 0;

        public test() {
        }

        public void paint(Graphics gr) {
          int r = 0, b = 0, g = 0, i;
          Color color = null;

          System.out.println("Paint Entered");

          b = 128;
          for (r = 0; r < 256; r++) {
            for (g = 0; g < 256; g++) {
      color = new Color(r, g, b);
      /*if (g%11 == 0) {
      setTitle("Color r:" + color.getRed() +
      " g:" + color.getGreen() +
      " b:" + color.getBlue());
      }*/
      if (color == null) {
      System.out.println("Detected null color");
      }
      gr.setColor(color);
      if (gr.getColor() != color) {
      System.out.println("Colors don't match");
      }
      gr.drawLine(r, g, r, g);
            }
          }
          System.out.println("Paint exit last color drawn:\n" + color);
        }

        public Dimension getPreferredSize() {
          return new Dimension(255, 255);
        }

        /*public static void main(String argv[]) {
          test t = new test();
          t.setBackground(Color.black);
          t.pack();
          t.show();
        }*/
      }



      company - COBITE , email - ###@###.###
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              dmendenhsunw David Mendenhall (Inactive)
              mchamnessunw Mark Chamness (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: