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

fp.bugs 3610 Macintosh Polygon problem

XMLWordPrintable

    • 1.0.2
    • ppc
    • solaris_2.5
    • Not verified

        >From: ###@###.### (Steve Zellers)
        This does not look like form output to me.


        Thanks for this prompt report; I'm adding it to our bug database.

        We hope to get a new release out "soon"; this _is_ beta software!

        Thanks,
        --smz

        >From: ###@###.### (John Chuang)
        >Subject: Re: Polygon *BUG* in MacJDK1.0b1?
        >Date: Wed, 14 Feb 1996 02:07:25 -0800
        >
        >In response to my own post, it looks like the problem is with Polygon
        >closure... If I add p.addPoint (10, 10) after p.addPoint (50, 10) in the
        >code below, the MacJDK1.0b1 Applet Viewer no longer throws the
        >ArrayIndexOutOfBoundsException.
        >
        >However, this closure is *not* required in Roaster, JDK for Win95,
        >Netscape 2.0...
        >
        >So, is it a bug?
        >
        >
        >Here is the new workable test code:
        >
        >import java.awt.Graphics;
        >import java.awt.Polygon;
        >import java.awt.Color;
        >
        >public class PolygonTest extends java.applet.Applet {
        > public void init () {
        > repaint ();
        > }
        >
        > public void update (Graphics g) {
        > paint (g);
        > }
        >
        > public void paint (Graphics g) {
        > Polygon p = new Polygon ();
        > p.addPoint (10, 10);
        > p.addPoint (10, 50);
        > p.addPoint (50, 50);
        > p.addPoint (50, 10);
        >
        > p.addPoint (10, 10); // new line to close polygon and prevent
        >MacJDK exception
        >
        > g.setColor (Color.red);
        > g.fillPolygon (p);
        > }
        >}


              duke J. Duke
              bhagen Benjamin Hagen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: