| Author |
Creating triangles using the Polygon class problem???
|
Luong Vuong
Greenhorn
Joined: Jan 20, 2007
Posts: 8
|
|
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
Joined: Jul 08, 2003
Posts: 24050
|
|
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!
|
[Jess in Action][AskingGoodQuestions]
|
 |
Luong Vuong
Greenhorn
Joined: Jan 20, 2007
Posts: 8
|
|
|
sorry about that.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24050
|
|
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
Joined: Jan 20, 2007
Posts: 8
|
|
Here is the full code: Hope that this code helps guys
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24050
|
|
|
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.
|
 |
 |
|
|
subject: Creating triangles using the Polygon class problem???
|
|
|