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

Graphics.fillRect(x,y,w,h) does not fill rectangle when x or y is too small

    XMLWordPrintable

Details

    • x86
    • linux

    Description



      Name: kaC94536 Date: 01/27/2000



         The code below should show window with blue background.
      But background of the window is not blue.
         
      ------------------------------ test.java -----------------------------
      import java.awt.*;

      class test extends Frame {
         static int x = -2000000;
         public static void main(String args[]) {
            test f = new test();
            f.setSize(200, 200);
            f.show();
         }
         public void paint(Graphics g) {
            g.setColor(Color.blue);
            g.fillRect(x,0, getBounds().width-x, getBounds().height);
         }
      }

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

      Attachments

        Activity

          People

            mbronsonsunw Mike Bronson (Inactive)
            kanisimosunw Konstantin Anisimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: