Exception to Number Format Exception with “D” and “F”?
问题 I have run into a very strange problem in my code. I have a simple temperature converter where the user enters the temperature in Celsius and, after pressing "Convert", the temperature in Fahrenheit is shown. If the user does not enter something valid (anything that is not a number or decimal) an error dialog box is shown. Code: btnConvert.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { String tempFahr = (String) enterDegreesC.getText(); double