jeudi 29 janvier 2015

Money accumulator buttons

I'm building a project for school and I want to make three money buttons (quarter, nickel and dime) that accumulates their value with every click of the button. When I'm done the text displayed will be grabbed and reParsed back to a double. I have that part done, I'm just drawing a blank on using a button accumulator.



double quarter = 0.0;

if (event.getSource() == quarterButton)
{
Possible loop???
quarter += .25;
}
String quarter2 = Double.toString(quarter);
amountDeposited.setText(quarter2);

Aucun commentaire:

Enregistrer un commentaire