Help with Calling a method
Hi I can't figure out how to make this part of my program work.. it keeps saying cannot find member variable g even though it worked in the paint method..
here's the code:
Code:
public void actionPerformed(ActionEvent ae)
{
EightBall displayAnswer = new EightBall();
EightBall answer = new EightBall();
String sMessage = ae.getActionCommand();
if( sMessage.equals("Ask"))
{
remove(text);
remove(askButton);
add(resetButton);
displayAnswer.displayAnswerTwo(g); //cannot find symbol variable g
}
if(sMessage.equals("Reset"))
{
remove(resetButton);
add(text);
add(askButton);
answer.displayAnswer (g); //cannot find symbol variable g
}
repaint();
}
Thanks.
Albert:rolleyes: