Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to solve the error { java.lang.NumberFormatException: empty String }

TAJDINApr 19 2013 — edited Apr 21 2013
Sir,

I am using the following code and get subjected error.


{error}{
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1011)
at java.lang.Double.parseDouble(Double.java:540)
at invoice.InvoiceController$4.changed(InvoiceController.java:192)
}{error}

and
{

//wt ,  sValExlSt1 and sPrice1 are numbers


 wt1.textProperty().addListener(new ChangeListener<String>() {
                public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
                    sValExlSt1.setText(String.valueOf(
                            Double.parseDouble(newValue)  * Double.parseDouble(sPrice1.getText())));
                }
            });
        } catch (NumberFormatException e1) {
        }

}
Please help.
This post has been answered by PhHein on Apr 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2013
Added on Apr 19 2013
3 comments
2,011 views