Once you go into GUIs you get several threads; you may crash a Thread with an Exception and still have the display on screen.
NullPointerExceptions are a standard beginner's problem. The hardest part is finding what causes them. Get a full stack trace for your Exception and find the first line in your code where it occurs. Look through every object in that line; you have done one of the following things:
Declared it and forgotten to instantiate it,set it to null,or lost it and forgotten to re-instantiate it.If you can't work out which it is, insert a
test line one line before where it happens rather like this:-
If you get a lot of incomprehensible writing on screen, assume your object exists; if it doesn't the
word "null" will appear. Find where you were supposed to instantiate that object and do so.
This exception appears very frequently; you will find lots more about it on these fora if you do a search.