ArrayIndexOutOfBoundsException error while drawing a polygon
问题 hi there i'm having a trouble while i'm trying to draw a polygon. first of all, when i try to draw a polygon with using addPoint(int x, int y) method and giving coordinates one by one there is no problem, polygon could be drawed perfectly. however, if i give the coordinates as an array (an integer array for x coordinates and y coordinates) compiler gives error. this is the working code as you can see, @Override public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; Polygon poly = new