java.lang.NumberFormatException: empty String

前端 未结 2 700
醉梦人生
醉梦人生 2020-11-27 23:45

The code below keeps giving a java.lang.NumberFormatException: empty String:

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt         


        
2条回答
  •  渐次进展
    2020-11-28 00:06

    The string you're trying to parse as double is empty. You need to check if the getText() method returns a non empty string before trying to do the parsing cause you can't parse to double an empty string.

提交回复
热议问题