java - which is better setExtendedState(JFrame.MAXIMIZED_BOTH) or GraphicsDevice device? -


i planning on making full screen application in java. have come across 2 sets of ways make application full screen.

1. frame.setextendedstate(jframe.maximized_both) 2. graphicsdevice device = graphicsenvironment.getlocalgraphicsenvironment().getscreendevices()[0];     device.setfullscreenwindow(frame); 

both of these same make frame full screen. know of these better? if use application on different screen resolution behave same .example projectors etc

approach 2. preferred. best thing check if fullscreen mode available:

if (device.isfullscreensupported()) {     device.setfullscreenwindow(frame); } else {     frame.setextendedstate(jframe.maximized_both); } 

maximizing frame equivalent of double-clicking title bar. not fill parts of screen used desktop's taskbar or other reserved areas, , decorations (title bar, border, close/minimize/maximize buttons) still visible, not want.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -