wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Someone Please, Help.. having Syntax problems with p.getx().. PLEASE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Someone Please, Help.. having Syntax problems with p.getx().. PLEASE" Watch "Someone Please, Help.. having Syntax problems with p.getx().. PLEASE" New topic
Author

Someone Please, Help.. having Syntax problems with p.getx().. PLEASE

greg layfield
Greenhorn

Joined: Feb 02, 2003
Posts: 2
Prog3.java:30: cannot resolve symbol
symbol : method getx ()
location: class Point
p.getx(); //getting x and y to use in the movements
^
Prog3.java:31: cannot resolve symbol
symbol : method gety ()
location: class Point
p.gety();

theres my two errors i am getting mostly
p.getx();
p.gety();
thats all i have in my code.. whats wrong?
Rich Raposa
Ranch Hand

Joined: Dec 06, 2001
Posts: 46
Capitalize the "X" and "Y". The methods are getX() and getY().
Java is sensitive that way.


Rich Raposa<br /><a href="http://www.javalicense.com" target="_blank" rel="nofollow">http://www.javalicense.com</a><br />Buy Java courseware -> get a free XBox!
greg layfield
Greenhorn

Joined: Feb 02, 2003
Posts: 2
thanks... i did that and it corrected it.. but now i am getting this:

Prog3.java:34: cannot resolve symbol
symbol : variable X
location: class Prog3
g.drawLine(X, Y, X, Y - 1);

heres my method:
public void move(int dir, Point p, Graphics g)
{
getX(); //getting x and y to use in the movements
getY();

if(dir == 0)
g.drawLine(X, Y, X, Y - 1);
p.setPoint(X, Y);

if(dir == 1)
g.drawLine(X, Y, X + 1, Y - 1);
p.setPoint(X, Y);

if(dir == 2)
g.drawLine(X, Y, X + 1, Y);
p.setPoint(X, Y);

if(dir == 3)
g.drawLine(X, Y, X + 1, Y + 1);
p.setPoint(X, Y);

if(dir == 4)
g.drawLine(X, Y, X, Y + 1);
p.setPoint(X, Y);

if(dir == 5)
g.drawLine(X, Y, X - 1, Y + 1);
p.setPoint(X, Y);

if(dir == 6)
g.drawLine(X, Y, X - 1, Y);
p.setPoint(X, Y);

if(dir == 7)
g.drawLine(X, Y, X - 1, Y - 1);
p.setPoint(X, Y);
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Do you not need int X = p.getX(); ? ( Similarly for Y )
Hard to say what you need to do because there's not enough program listed.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Someone Please, Help.. having Syntax problems with p.getx().. PLEASE