Java Polygon2D compiler error -


i new java , trying implement polygon can transformed. think requires polygon2d following code produces compiler error of "package polygon2d not exist":

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import java.awt.geom.*;   ....     public void paintcomponent(graphics g) {         graphics2d g2 = (graphics2d) g;         g2.setpaint(thecolor);         setopaque(true);         int[] xs = new int[]{250,350,350,400,350,350,250};         int[] ys = new int[]{200,200,225,175,125,150,150};         g2.draw(new polygon2d.double(xs, ys, xs.length));  //error here         g2.rotate(math.toradians(45));         } .... 

thanks , patience(hopefully!)

your package doesn't exist. @ top of class, there should package identification. if said correctly, it's named polygon2d isn't java package in class, ever code is, exists. need alter match correct package in class exists.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -