yes you have made the mistake on this line


gMain.window.setLocation(null);


your code set the null location. So you have got the null pointer exception

you set any values in location like...