Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop p

game development | full screen window

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. 

Java game development series

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