Check out example codes for "set jframe fullscreen". It will help you in understanding the concepts better.

Code Example 1

frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

Code Example 2

GraphicsEnvironment graphics = 
		GraphicsEnvironment.getLocalGraphicsEnvironment();
        
GraphicsDevice device = graphics.getDefaultScreenDevice();
JFrame frame = new JFrame("Fullscreen");
device.setFullScreenWindow(frame);

Learn ReactJs, React Native from akashmittal.com