Results 1 to 2 of 2
  1. #1
    coco is offline Member
    Join Date
    Jul 2007
    Posts
    39
    Rep Power
    0

    Default Error: NumberFormatException

    Hi, This is a mystery to me. I've tried simplifying my code to see where the problems arise..but I can't make it any simpler..and the NumberFormat still won't accept 0, or 0.0 as numbers.
    Java Code:
    try
    {
    Double.parseDouble(jTxtFAmount.getText());
    }
    catch(NumberFormatException ex)
    {
    jTxtArea.append("The amount entered is illegal\n"+ex.getMessage()+"\n");
    }
    I'd just as well say, you can't have a zero balance, because that's what the exception keeps catching.
    Thanks.

  2. #2
    toby is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    Just a guess, but I think when you use parseDouble and parseInt, if the result returned is 0, it is equivalent to null. See if you can add something for the null exception.

Similar Threads

  1. Replies: 2
    Last Post: 08-07-2007, 04:50 PM
  2. java.lang.NumberFormatException: null
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-05-2007, 06:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •