bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/34991] New: java.awt.Graphics2D.drawPolyline(int[] xs, int[]


From: asch at freemail dot hu
Subject: [Bug swing/34991] New: java.awt.Graphics2D.drawPolyline(int[] xs, int[] ys, int n) draws one more line
Date: 27 Jan 2008 21:56:21 -0000

The java.awt.Graphics2D.drawPolyline connects the first point with the last one
so it works as drawPolygon should work.
This code demonstrates the problem:


import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.JFrame;

public class C extends JFrame{
        public static void main(String[] args)
        {
                C c= new C();
                c.setVisible(true);
                c.setSize(200,200);
                JComponent cmp=new JComponent(){
                        private static final long serialVersionUID = 1L;
                        @Override
                        public void paint(Graphics g) {
                                int n=3;
                                int[] xs=new int[n];
                                int[] ys=new int[n];
                                xs[0]=100;
                                ys[0]=100;
                                xs[1]=150;
                                ys[1]=100;
                                xs[2]=150;
                                ys[2]=150;
                                g.drawPolyline(xs, ys, n);
                        }
                        };
                c.add(cmp);
        }

}


-- 
           Summary: java.awt.Graphics2D.drawPolyline(int[] xs, int[] ys, int
                    n) draws one more line
           Product: classpath
           Version: 0.92
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: swing
        AssignedTo: roman at kennke dot org
        ReportedBy: asch at freemail dot hu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34991





reply via email to

[Prev in Thread] Current Thread [Next in Thread]