wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Creating triangles using the Polygon class problem??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Creating triangles using the Polygon class problem???" Watch "Creating triangles using the Polygon class problem???" New topic
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: 24183
    
  34

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: 24183
    
  34

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: 24183
    
  34

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating triangles using the Polygon class problem???
 
Similar Threads
Trying to use an existing java.awt.Polygon in my JSP
Access a variable
POLYPOLYGON
recursion - sierpinskys triangle - HELP!!
Problem with protected variable...