Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Displaying an error message using exceptions

My Application:
https://hastebin.com/fagabexupi.cs

So I am trying to display an error message when the user inputs something other than a number in the box. Lines 20-23 is what should show up but instead, I get this message when inputting letters instead of numbers.

https://i.imgur.com/SfzNyEQ.png


Any help with this?
This is because the exception that is actually thrown is a NumberFormatException, not an InputMismatchException.
(Apr 9, 2017 02:17 PM)Stealth™ Wrote:  This is because the exception that is actually thrown is a NumberFormatException, not an InputMismatchException.

Thank you man! 🤝


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by dawid17Oct 17, 2020 05:22 AM 1 137 Oct 17, 2020 05:22 AM
Last Post: saltycracker
[.NET] by Ferrari F40Dec 7, 2019 12:07 PM 1 255 Dec 7, 2019 12:07 PM
Last Post: itcorp
[C#] by Iera NamhorunJun 26, 2019 04:28 AM 4 241 Jun 26, 2019 04:28 AM
Last Post: Iera Namhorun