@Override public void windowClosing(WindowEvent evt) { // If required, restore the previous display mode if (isDisplayModeModified) { gd.setDisplayMode(previousDisplayMode); } // If required, get back to the windowed mode if (gd.getFullScreenWindow() == frame) { gd.setFullScreenWindow(null); } windowCloseRequest.set(true); } @Override
@Override public boolean isFullScreenMode() { return getScreenDevice().getFullScreenWindow() != null; }
@Override public void startWindowDialog(Window window) { GraphicsDevice localDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); if (localDevice.getFullScreenWindow() != null) { localDevice.setFullScreenWindow(null); } window.setVisible(true); }
private void jmiFullscreenActionPerformed(java.awt.event.ActionEvent evt) { GraphicsDevice gd = this.gameFrame.getGraphicsConfiguration().getDevice(); if (gd.getFullScreenWindow() != null) { gd.setFullScreenWindow(null); this.gameFrame.setResizable(true); this.gameFrame.setPreferredSize(new Dimension(400, 300)); } else { this.gameFrame.setResizable(false); this.gameFrame.setPreferredSize(new Dimension(gd.getDefaultConfiguration().getBounds().getSize())); this.gameFrame.enableInputMethods(false); gd.setFullScreenWindow(this.gameFrame); } refresh(); }
@Override public void windowClosing(WindowEvent evt) { // If required, restore the previous display mode if (isDisplayModeModified) { gd.setDisplayMode(previousDisplayMode); } // If required, get back to the windowed mode if (gd.getFullScreenWindow() == frame) { gd.setFullScreenWindow(null); } windowCloseRequest.set(true); } @Override
/** * Makes a window full screen (method 1). Returns false if not supported. */ public static boolean setFullScreen(Window toplevel, boolean fullscreen) { GraphicsDevice device; device = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice(); if (USE_TRUE_FULL_SCREEN && device.isFullScreenSupported()) { boolean currentlyfullscreen = device.getFullScreenWindow() == toplevel; if (fullscreen != currentlyfullscreen) device.setFullScreenWindow(toplevel); return true; } return false; }
/** * Switch off full screen mode. This also resets the display mode if it's * been changed. */ private void restoreScreen() { Window w = gd.getFullScreenWindow(); if (w != null) w.dispose(); gd.setFullScreenWindow(null); } // end of restoreScreen()
@Override public void windowClosing(final WindowEvent e) { _isClosing = true; // If required, restore the previous display mode if (isDisplayModeModified) { gd.setDisplayMode(previousDisplayMode); } // If required, get back to the windowed mode if (gd.getFullScreenWindow() == JoglCanvas.this) { gd.setFullScreenWindow(null); } } });
@Override public void endWindowDialog() { if (displayMode != null) { GraphicsDevice localDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); if (localDevice.getFullScreenWindow() == null) { localDevice.setFullScreenWindow(this); setDisplayMode(); } if (useFullscreen) { setFullScreenDisplaySize(); } } }
private void toggleFullScreenWindow() { GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice(); if(graphicsDevice.getFullScreenWindow()==null) { dialog.dispose(); //destroy the native resources dialog.setUndecorated(true); dialog.setVisible(true); //rebuilding the native resources graphicsDevice.setFullScreenWindow(dialog); }else{ graphicsDevice.setFullScreenWindow(null); dialog.dispose(); dialog.setUndecorated(false); dialog.setVisible(true); dialog.repaint(); } requestFocusInWindow(); }
public void update() { this.osName = System.getProperty("os.name"); this.osVersion = System.getProperty("os.version"); this.osArch = System.getProperty("os.arch"); this.javaVersion = System.getProperty("java.version"); this.javaVendor = System.getProperty("java.vendor"); Runtime rtime = Runtime.getRuntime(); this.freeMemory = (rtime.freeMemory() / 1024L); this.totalMemory = (rtime.totalMemory() / 1024L); this.usedMemory = (this.totalMemory - this.freeMemory); this.maxMemory = (rtime.maxMemory() / 1024L); this.isHeadless = GraphicsEnvironment.isHeadless(); if (this.isHeadless) { return; } try { GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = env.getDefaultScreenDevice(); DisplayMode mode = gd.getDisplayMode(); this.bitDepth = mode.getBitDepth(); this.refreshRate = (mode.getRefreshRate() / 1024); this.isFullScreen = (gd.getFullScreenWindow() != null); this.displayWidth = mode.getWidth(); this.displayHeight = mode.getHeight(); } catch (Throwable t) { this.isHeadless = true; } }
bitDepth = mode.getBitDepth(); refreshRate = mode.getRefreshRate() / 1024; isFullScreen = (gd.getFullScreenWindow() != null); displayWidth = mode.getWidth(); displayHeight = mode.getHeight();
BufferedImage screenshot; GraphicsDevice gd = GraphicsEnvironment .getLocalGraphicsEnvironment() .getDefaultScreenDevice(); Window window = gd.getFullScreenWindow(); if(window == null) { Robot robot = new Robot(); GraphicsConfiguration config = gd.getDefaultConfiguration(); screenshot = robot.createScreenCapture(config.getBounds()); } else { screenshot = new BufferedImage(window.getWidth(), window.getHeight(), BufferedImage.TYPE_INT_RGB); window.paint(screenshot.getGraphics()); } ImageIO.write(screenshot, "png", file);
return vc.getFullScreenWindow(); Window w = vc.getFullScreenWindow(); if (w != null) { w.dispose();
return gd.getFullScreenWindow(); Window w = gd.getFullScreenWindow(); if (w != null) { w.dispose();
/** * Gets the window hosting the specified Display and makes it visible.</br> * This will cause a visible {@link SplashScreen} to be closed.<br/> It is * intended to be called one time when the Pivot application has initialized * its UI and the SplashScreen is ready to be dismissed, but can be safely * called regardless of whether there is now, or used to be, a visible * SplashScreen. * * @param display Display to make visible * @see java.awt.SplashScreen */ public static void replaceSplashScreen(Display display) { java.awt.Window hostWindow = display.getHostWindow(); GraphicsDevice device = windowedHostFrame.getGraphicsConfiguration().getDevice(); if ((hostWindow == fullScreenHostFrame) && (device.getFullScreenWindow() == null)) { device.setFullScreenWindow(fullScreenHostFrame); } hostWindow.setVisible(true); }
/** * Gets the window hosting the specified Display and makes it visible.</br> * This will cause a visible {@link SplashScreen} to be closed.<br/> It is * intended to be called one time when the Pivot application has initialized * its UI and the SplashScreen is ready to be dismissed, but can be safely * called regardless of whether there is now, or used to be, a visible * SplashScreen. * * @param display Display to make visible * @see java.awt.SplashScreen */ public static void replaceSplashScreen(Display display) { java.awt.Window hostWindow = display.getHostWindow(); GraphicsDevice device = windowedHostFrame.getGraphicsConfiguration().getDevice(); if ((hostWindow == fullScreenHostFrame) && (device.getFullScreenWindow() == null)) { device.setFullScreenWindow(fullScreenHostFrame); } hostWindow.setVisible(true); }
return videoCard.getFullScreenWindow(); //returns ur window Window w = videoCard.getFullScreenWindow();
changeFrameFullScreenMode(Frame app){ GraphicsDevice gd = GraphicsEnvironment .getLocalGraphicsEnvironment().getDefaultScreenDevice(); if (gd.getFullScreenWindow() == null){ app.dispose(); app.setUndecorated(true); gd.setFullScreenWindow(app); app.setVisible(true); }else{ // back to windowed mode app.dispose(); app.setUndecorated(false); gd.setFullScreenWindow(null); app.setVisible(true); } }
final GraphicsDevice device = gconfig.getDevice(); if (device.isFullScreenSupported()) { if (device.getFullScreenWindow() == null) { final JLabel label = new JLabel("Opened in full screen"); final int tabIndex = this.tabPane.getSelectedIndex();