public static MasterWindow getMasterWindow() { if(masterWindow == null) { try { throw new InstanceNotFoundException("The MasterWindow is not created yet"); } catch (Exception e) { e.printStackTrace(); } return null; } else { return masterWindow; } }