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

Regression Graphics.DrawRect() rounds the edges in JDK1.4beta2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • beta3
    • x86
    • windows_nt

      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

      After I use a 'Graphics.setXORMode()' operation I cannot get the
      'Graphics.drawRect();' method to draw correctly.

      This bug seems to be only reproducable on Windows, Linux, and
      Solaris machines. This code works correctly in JDK1.3.x, but
      not in JDK1.4B2.

      Under JDK1.3.1 ---- Rectangle Displayed correctly
      When running this program you will notice that the string "Hello"
      is printed and a completely blue sqaure box is displayed. The box
      is cleanly viewable, i.e. the edges meet at 90 degree angles.

      Under JDK1.4beta2-b77 ---- Rectangle NOT displayed Correctly
      When running this program you will notice that the string "Hello"
      is printed and a blue box but the edges are rounded. The edges don't seem
      to meet edge to edge.

      NOTE: THE "GOODBYE" STRING DOES NOT DISPLAY UNDER 1.4. THIS INCIDENT IS
            FILED AS A SEPERATE BUG UNDER BUG ID 4505650

      This seems to be a Regression bug


      Source Code
      ----------------------
      import java.awt.*;
      import javax.swing.*;

      public class TestBug extends JPanel {


          public void paintComponent(Graphics g) {
      super.paintComponent(g);

      Font defaultFont = new Font("Dialog", Font.PLAIN, 9);
      g.setFont(defaultFont);

      g.setColor(Color.black);
      g.drawString("Hello", 10, 10);

      g.setColor(Color.white);
      g.setXORMode (Color.blue);
      g.drawRect(30, 10, 10, 10);
      g.setPaintMode();
      g.setColor(Color.black);

          // The following will not display in JDK1.4B2, but will in JDK1.3
          //This bug is listed under Bug ID 4505650
      g.drawString("Goodbye", 10, 50);

          }

         public static void main(String[] args) {

            JFrame f = new JFrame("Test");
            f.getContentPane().add(new TestBug());
            f.setSize(100,100);
            f.setVisible(true);
         }
      }

            flar Jim Graham
            ddressersunw Daniel Dresser (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: