Thanks to all for your thoughtful replies:
You have a file called "App.java" and the exception is occurring at its line 202). Just check that line and you'll know where the exception came from. A NullPointerException is usually considered a programming error.
Eddie and David - I tried to track this line down but I can only count 157 lines of code in the file (I thought blanks and commented out lines didn't count). If I include the commented out lines I still only have 199. Any ideas about line numbers?
As to the exception handling and comparing err.message to a
string. The assignment requires the following method (exactly):
Additional exceptions must also be caught (for example a space or alphabetic character entered instead of a number in the miles or gallons Text Field).
My thinking for this try/catch block was that the catch only applies when an exception occurs. In this case the exception could come from one of the parseDouble statements (for data not compatible with a Double) or from the exception thrown by the mpg method. While somewhat simplistic, for the limited purpose of this assignment it seems to work ok.
As I stated before, my program seems to function exactly as expected except when I close it down - meaning all the calculations work with correct data, the expected error messages occur with incorrect data, no exceptions show up on the command line while the program is running. Only when I close it (by clicking the X in the top right hand corner of the window) does the NullPointerException occur.
Is it possibly coming from the interuption of this endless loop?
Thanks again for all you assistance.
Bob