When will I use full screen mode? Perhaps the opportunity to use is very small, but JDK is a function of this. Like the print preview feature in many software, there are also some text editors in order to get a larger editing screen, but also use full-screen mode if you are interested in writing a software like ACDSEE, using full screen mode to make The user sees a larger picture picture. How to use full screen mode? The key is two classes related to the display devices in java.awt. *: Graphicsenvironment and GraphicsDevice. Graphicsenvironment provides the Java application with a specific platform's GraphicsDevice object and Font object collection. These GraphicsDevice can be resources of various local and remote machines, such as screens, printers, or Image Buffers, or even target objects for Graphics2D drawing methods. GraphicsDevice refers to a specific graphical environment, such as screens and printing devices. This way, we can use GraphicsDevice to manipulate the screen. The setFullScreenWindow () method provided by GraphicsDevice is to set the full screen. Since Graphicsenvironment's constructor is protected (protected), we cannot directly construct a GraphicSenvironment object to get a GraphicsDevice object. Fortunately it provides a getLocalGraphicsenvironment () method to get a Graphicsenvironment instance:
Graphicsenvironment Ge = graphicsenvironment.getlocalgraphicsenvironment (); With Graphicsenvironment, you can call the getDefaultscreenDevevice method to get the current screen device:
GraphicsDevice gd = ge.GETDEFAULTSCREENDEVICE (); he has a hand experience with the above profile, write an instance to experience it: