File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating triangles using the Polygon class problem???

 
Luong Vuong
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am trying to create a triangle using the Polygon class. Eventually the program should allow the user to click on the screen and triangles should appear. I the programmer decide the size of the triangle.


When i try to compile i get the following error message
Cannot find symbol variable x
---- find symbol variable y.

Please help, urgent

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

We have a strict policy on display names, which must be a real first and last name with a space between.

Please go here and fix your display name up, pronto. Thanks, pardner!
 
Luong Vuong
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about that.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

OK, so what is "myTri" declared as? If it's a java.awt.Polygon, there is an xpoints and a ypoints, but no x or y. But you've also declared your own x and y variables, so I'm not quite sure what you're doing; maybe you should show us more code.
 
Luong Vuong
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the full code:

Hope that this code helps guys
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid there may be some organizational problems that are preventing you from communicating effectively with us. Your previous code snippet is not a subset of this larger code -- in fact, it differs in the crucial aspect of how "x" and "y" are used. And aside from a few missing close-braces at the end, and the use of the undefined variable m_WndFont, this code compiles fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic