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

Graphics.fillPolygon(...) depends on it's position on the screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P4
    • 5.0-pool
    • 5.0
    • client-libs
    • None
    • 2d
    • sparc
    • solaris_8

    Description



      Name: spR10137 Date: 10/14/2003



      Compile and run simple application. Try to change frame's position
      on the screen. Notice, that polygon behaviour depends on it's
      position. It looks defferent in left and right parts of the screen.

      -------------------- ScreenPos.java --------------------
      import java.awt.*;
      import java.awt.event.*;

      public class ScreenPos extends Frame implements ComponentListener {

          int[] xpts = {0x0a, 0x0a, 0x7e00, 0x3c};
          int[] ypts = {0x0a, 0x14, 0x32, 0x5a};
          Canvas c;
          public ScreenPos() {
              super("Fill GP Test");

              c = new Canvas() {
                  public void paint(Graphics g) {
                      g.setColor(Color.black);
                      g.fillPolygon(xpts, ypts, 4);
                  }
              };
              c.setSize(100, 300);
              c.setBackground(Color.white);
              add(c);
              addComponentListener(this);
          }

          public static void main(String[] args) {
              ScreenPos sp = new ScreenPos();
              sp.pack();
              sp.show();
          }

          public void componentHidden(ComponentEvent e) {
          }

          public void componentMoved(ComponentEvent e) {
              c.repaint();
          }

          public void componentResized(ComponentEvent e) {
              c.repaint();
          }

          public void componentShown(ComponentEvent e) {
              c.repaint();
          }
      }
      -------------------- end of file --------------------

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

      Attachments

        Issue Links

          Activity

            People

              avu Alexey Ushakov
              spikalev Sergei Pikalev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: