I have the GUI displaying and if I click a digit it will display the digits but when I click two digits simultaneously just the last digit clicked will display.
I know I need to declare a String but I am not sure how to do this.
Any assistance would be greatly appreciated.
This is my code for the method.
package calculator;
public class CalculatorController {
private final CalculatorModel model;
public String displayNumbers = "";
public CalculatorController(CalculatorModel model) {
this.model = model;
}
public void buttonPushed(String buttonLabel) {
if (buttonLabel.equals("C")){
model.setDisplay("0.");
}
else
model.setDisplay(buttonLabel + "");
}
}

New Topic/Question
Reply



MultiQuote





|