# java GPolygon Constructor



## Webman (Oct 4, 2004)

Hey was wondering if anyone has an example of code where they use the GPolygon constructor using this format: GPolygon(GPoint[] points)

http://jtf.acm.org/javadoc/student/index.html this is the documentation, I couldn't get my code to compile, not sure what the exact syntax is.


----------



## Chicon (Jul 29, 2004)

Hi Webman,

You should first download the acm.jar file from this page.
Then you adapt the compiler options of your IDE to access the classes embedded in acm.jar.


----------



## Webman (Oct 4, 2004)

I already have the acm.graphics package, it's just a matter of using the right syntax I think


----------



## Chicon (Jul 29, 2004)

Just try this, for example :



```
GPoint[] gp = new GPoint[3];    // if you want a triangle

gp[0] = new GPoint(0,0);
gp[1] = new GPoint(1,1);
gp[2] = new GPoint(2,3):

GPolygon triangle = new GPolygon(gp);
```


----------



## Webman (Oct 4, 2004)

ok thanks, that's what I was looking for


----------



## skeetercabc (Feb 2, 2007)

Get an error saying " Java runtime enviroment cannot be loaded.


----------



## Webman (Oct 4, 2004)

what program are you using to compile? You might not have the latest version of java, or you are missing some of the java packages you need like the acm graphics, or the java.awt package.


----------



## skeetercabc (Feb 2, 2007)

Dell searched my computer systems and said it was completely updated. I just purchased it in Dec. Dell said I had the latest versions


----------



## Webman (Oct 4, 2004)

what exactly are you trying to do? I assumed that you were having the same problem as me but you never really stated clearly what you were trying to do when you got the error JRE can not be loaded. There are two things you need, one is the normal java jdk, and there is the jre, both can be found at the http://java.sun.com site.


----------

