Please go through the fora and search for NullPointerException (NPE); everybody gets them, everybody gets annoyed about them, and everybody needs to know how to handle them. The hard part is finding out
why they happen.
You have some very unconventional code in your class; you are instantiating a field (which should, by the way, be declared "private") in a method rather than in a constructor. Please instantiate your field in the constructor and call it by saying
new DemoSw();.
You have got a strange method in your mouseListener class. A MouseAdapter doesn't have an actionPerformed method, so that is an inappropriate class to extend. Go through these fora and you will find discussions about how to use ActionListeners,
eg here.
If you have a MenuItem, it will support ActionListeners, so you don't need a new class.
And put in a line just before the line where the NPE occurs like this:
System.out.printf("timeToSet == null: %b. jTimefld == null %b%n", timeToSet == null, jTimefld == null);
If you get "false" for both, then the problem lies elsewhere.
Please use ctrl-C ctrl-V to quote code; it is much easier to handle when we know we have the exact code which is causing problems:
PostRealCode.