Compiling error key(int,int) in ATM2.ATMPanel cannot be applied to (int)

Joined
Dec 16, 2007
Messages
2
Reaction score
0
This is what the compiling error is pointing to:

key(Integer.parseInt(((Button) e.getSource()).getLabel()));

This is what the previous line of code is refering to:

private void key(int key, int account)
 
Joined
Dec 16, 2007
Messages
2
Reaction score
0
So here is the code I took out the second int but I get this error what should I do to fix this. The error states that it cannot find symbol account. However whenever I enter int account into the private void key(int key) it gives me the error listed above.

private void key(int key)
{
switch (state)
{

case WAIT_FOR_CARD: // waiting for card
mScreen.setText("Please insert your card");
if (mMember.length() == 0)
mScreen.setText("");
mMember += String.valueOf(key);
mScreen.setText(mScreen.getText() +"*");
clear();
mScreen.setText(
"Card accepted.\n" +
"Good evening.\n" +
"Please enter your pin...");
state = WAIT_FOR_PIN;
break;
case WAIT_FOR_PIN: // waiting for pin
if (mPassword.length() == 0)
mScreen.setText("");
mPassword += String.valueOf(key);
mScreen.setText(mScreen.getText() +"*");
clear();
mScreen.setText(
"PIN accepted.\n"+
"Which account would you like to access?");
break;
case ACCOUNTS_DISPLAYED:
switch(account)
{
case 1:
Checking();
break;
case 2:
Savings();
break;
default:
InvalidOption();
}
break;
case MENU_DISPLAYED:
switch(key)
{
case 1:
TransMoney();
break;
case 2:
DispenseMoney();
break;
case 3:
CheckBalance();
break;
default:
InvalidOption();
}
break;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top