[Solved] Java Calculator minus error
Take a look at your btMinusActionPerformed method: private void btMinusActionPerformed(java.awt.event.ActionEvent evt) { // minus button firstNumber = Float.parseFloat(calScreen.getText()); OP = “-“; numberClick += 1; if (!calScreen.getText().equals(“-“) && numberClick == 2){ btEqual.doClick(); } else { calScreen.setText(“-“); // <- What does this do? } } Then take a look at the btEqualActionPerformed method: private void btEqualActionPerformed(java.awt.event.ActionEvent evt) … Read more