Null exception from canceling JDialog
Hello, this is my first post! :D
I am in CIS 163 - second level java at GVSU. We are on our second project and its main theme is polymorphism... fun stuff. Anywho, my issue isn't from polymorphism but rather from canceling a JDialog box. Since no textfields in the box were filled, the result from hitting cancel is a Null Pointer Exception. I don't want to post my code right away due to it being sorta lengthy.
Normally, the person would fill out the textfields and hit OK. It would then send the data to another class and it would display the data accordingly. However, if they hit cancel it blows up. I have tried to google and bing search for sample code but with no luck. I searched for a bit on this site to see if anyone else made a thread about it but no luck either. Alas, I am creating a thread to plea for help!
I have tried using try-catches but it didn't work or I am not using it right.
Thank you very much!