hi I have build this calculation program, one tab is a scientific, one tab is a standard and the other is a binary. havent started to code the binary nor the scientific part as yet but I have finished coded the standard part already.
The errror that I am experiencing as stated in the caption above, is where, everytime I tried to calculated any double digit, i got that error: java.lang.NumberFormatException.
if i tried to either divide, add, substract or multiply any double digit, I would got that error, when I either add, substract, or multiply it works fine but when i tried to divide single numbers, I got that error.
here is the codes that I used
private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() +" 1 ");
}
private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 2 ");
}
private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 3");
}
private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 4 ");
}
private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 5 ");
}
private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 6 ");
}
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 7 ");
}
private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 8 ");
}
private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 9 ");
}
private void jButton24ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " 0");
}
private void jButton13AdditionActionPerformed(java.awt.event.ActionEvent evt) {
firstDouble = (Double.parseDouble(String.valueOf(display.getText())));
display.setText("");
plusClick = 1;
}
private void jButton15SubstractionActionPerformed(java.awt.event.ActionEvent evt) {
firstDouble = (Double.parseDouble(String.valueOf(display.getText())));
display.setText("");
minusClick = 1;
}
private void jButton19MultiplyActionPerformed(java.awt.event.ActionEvent evt) {
firstDouble = (Double.parseDouble(String.valueOf(display.getText())));
display.setText("");
multiplyClick = 1;
}
private void jButton23DivideActionPerformed(java.awt.event.ActionEvent evt) {
firstDouble = (Double.parseDouble(String.valueOf(display.getText())));(this is where the problem really lies,(java.lang.numberformatexception
display.setText("");
divideClick= 1;
}
private void jButton25ActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(display.getText() + " . ");
}
private void jButton12ClearActionPerformed(java.awt.event.ActionEvent evt) {
display.setText(" ");
}
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {
disable();//to call the disable method
}
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {
enable();//to call the enable method
}

