code: public static void toggleFullScreen(@NonNull JFrame frame)
  	{
  		GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
  		frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  		if (frame.equals(device.getFullScreenWindow()))
  		{
  			device.setFullScreenWindow(null);
  		}
  		else
  		{
  			frame.setVisible(true);
  			device.setFullScreenWindow(frame);
  		}
  	}
docs: Toggle full screen.
  
  @param frame
  the frame