1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

java GPolygon Constructor

Discussion in 'Software Development' started by Webman, Feb 2, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. Webman

    Webman Thread Starter

    Joined:
    Oct 3, 2004
    Messages:
    167
    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.
     
  2. Chicon

    Chicon

    Joined:
    Jul 29, 2004
    Messages:
    6,650
    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.
     
  3. Webman

    Webman Thread Starter

    Joined:
    Oct 3, 2004
    Messages:
    167
    I already have the acm.graphics package, it's just a matter of using the right syntax I think
     
  4. Chicon

    Chicon

    Joined:
    Jul 29, 2004
    Messages:
    6,650
    Just try this, for example :

    Code:
    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);
    
    
     
  5. Webman

    Webman Thread Starter

    Joined:
    Oct 3, 2004
    Messages:
    167
    ok thanks, that's what I was looking for
     
  6. skeetercabc

    skeetercabc

    Joined:
    Feb 2, 2007
    Messages:
    5
    Get an error saying " Java runtime enviroment cannot be loaded.
     
  7. Webman

    Webman Thread Starter

    Joined:
    Oct 3, 2004
    Messages:
    167
    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.
     
  8. skeetercabc

    skeetercabc

    Joined:
    Feb 2, 2007
    Messages:
    5
    Dell searched my computer systems and said it was completely updated. I just purchased it in Dec. Dell said I had the latest versions
     
  9. Webman

    Webman Thread Starter

    Joined:
    Oct 3, 2004
    Messages:
    167
    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.
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/540406

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice