This post of this java game development series walks you thru a way to create a full-screen application.
If you are new to this blog, then please follow this blog, therefore, you'll not miss any update.
Coding a full-screen app in java
To form a full-screen app you wish to access the Graphics device object.
below is that the code snippet to request a Graphics device object.
// get the graphics environment object
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
// get the graphics device from ge
gd = ge.getDefaultScreenDevice();
Thru the GraphicsDevice object, we'll set JFrame window to full screen by invoking the setFullScreenWindow(JFrame) method.
Similarly we can also return the app from full screen to window thru this method. To do this you just have to pass null instead of JFrame.
FullScreenApp example
By hitting the escape key you may close the app.
No comments:
Post a Comment