private void jButton21ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton21ActionPerformed // TODO add your handling code here: cal.a = Double.valueOf(Result.getText()); Result.setText(""); state = "/"; } // GEN-LAST:event_jButton21ActionPerformed
private void jButton22ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton22ActionPerformed // TODO add your handling code here: temp = Result.getText(); if (temp == "") { } else { if (Double.valueOf(temp) > 0) { temp = "-" + temp; } else { temp = temp.replace("-", ""); } Result.setText(temp); } } // GEN-LAST:event_jButton22ActionPerformed
private void jButton17ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton17ActionPerformed // TODO add your handling code here: aftereq = true; cal.b = Double.valueOf(Result.getText()); if (state == "+") { cal.tambah(); Result.setText(String.valueOf(cal.c)); } else if (state == "-") { cal.kurang(); Result.setText(String.valueOf(cal.c)); } else if (state == "*") { cal.kali(); Result.setText(String.valueOf(cal.c)); } else { cal.bagi(); Result.setText(String.valueOf(cal.c)); } } // GEN-LAST:event_jButton17ActionPerformed