The Artima Developer Community
Sponsored Link

Java Answers Forum
Help needed urgently

1 reply on 1 page. Most recent reply: Aug 12, 2003 6:16 AM by David

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Anne

Posts: 1
Nickname: annne
Registered: Aug, 2003

Help needed urgently Posted: Aug 9, 2003 9:48 PM
Reply to this message Reply
Advertisement
In my paint method, I tried calling the methods from another class it looks theoretically correct to me, but when I compile I get the error cannot resolve symbol. Can someone pls explain why?? Thanks. Newbie here.

public void paint (Graphics g){

super.paintComponents(g);

if ( clicked.equals("serve"){showTrolley=true;}


else if ( clicked.equals("noodles") ){
showTrolley=true;
displayBox(g, 50, 100, "noodles");
}

else if ( clicked.equals("vermicelli") ) {
showTrolley=true;
displayBox(g, 50, 100, "vermicelli");
}

else if ( clicked.equals("beer") ) {
showTrolley=true;
displayCylinder(g, 50, 100, "beer");
}

else {
showTrolley=true;
displayCylinder(g, 50, 100, "wine");
}

}
-----------------------------------------------------------
public void displayCylinder(Graphics g, int x, int y, String clicked)
{
if (clicked.equals("wine") ) {
g.setColor(Color.red);
g.drawRect(x, y+20, 30,100);
}

if (clicked.equals("beer") ); {
g.setColor(Color.orange);
g.drawRect(x, y+20, 30,100);
}
}

}
------------------------------------------------------------
public void displayBox(Graphics g, int x, int y, String clicked)
{
if ( clicked.equals("noodles") ) {
g.setColor(Color.yellow);
g.drawRect(x, y+35, 250,30);
}

if ( clicked.equals("vermicelli") ); {
g.setColor(Color.cyan);
g.drawRect(x, y+35, 250,30);
}
}


*displayCylinder and displayBox are from two separate classes.

Can someone please help?


David

Posts: 150
Nickname: archangel
Registered: Jul, 2003

Re: Help needed urgently Posted: Aug 12, 2003 6:16 AM
Reply to this message Reply
Can you please post the compiler error please? Which method can't it resolve?

Flat View: This topic has 1 reply on 1 page
Topic: JAVA 3D Previous Topic   Next Topic Topic: Priority Queue using linked list

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use