Exiting full screen exclusive mode in Java AWT

On November 28, 2016 by aTutorMe

We’ve been using Java AWT and Swing and needed full screen exclusive mode. (Not using JavaFX at the moment – but will be transitioning soon.)

This tutorial provides a nice way to enter full screen mode:
https://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html

One problem that I faced was getting out of full screen mode after setting a window/JFrame as full screen.

The solution turns out to be simple:

myDevice.setFullScreenWindow(null);

See:
https://docs.oracle.com/javase/tutorial/extra/fullscreen/displaymode.html