Looks like some sort of issue with initialization because the only way for getLocationName() to return null is for "rdbtnFalador" to return null. Have GUI extend JFrame then you won't have to worry about it. Alternatively look at your stacktrace, the IDE will literally tell you where the null is coming from.