public void setFullscreen(boolean fullscreen) {
	if (Client.instance.preferences.video.fullscreen == fullscreen) {
	    try {
		Class<?> application = Class.forName("com.apple.eawt.Application");
		Method getApplication = application.getMethod("getApplication");
		Object app = getApplication.invoke(null);
		Method requestToggleFullScreen = application.getMethod("requestToggleFullScreen", Window.class);
		requestToggleFullScreen.invoke(app, window);
	    } catch(Exception e) {
		e.printStackTrace();
	    }
	}
    }