Hi Evin,
If the program works in the IDE but not as a stand alone jar file the problem is probably not in your
Java code. But I admit I didn't even read it.
Which IDE are you using and how did you create the jar? And what error do you get when you try to run it?