Example usage for java.lang InternalError printStackTrace

List of usage examples for java.lang InternalError printStackTrace

Introduction

In this page you can find the example usage for java.lang InternalError printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.rdv.ui.MainPanel.java

private boolean enterFullScreenMode() {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] devices = ge.getScreenDevices();
    for (int i = 0; i < devices.length; i++) {
        GraphicsDevice device = devices[i];
        if (device.isFullScreenSupported() && device.getFullScreenWindow() == null) {
            log.info("Switching to full screen mode.");

            frame.setVisible(false);/*w  w w . jav  a 2s.  com*/

            try {
                device.setFullScreenWindow(frame);
            } catch (InternalError e) {
                log.error("Failed to switch to full screen exclusive mode.");
                e.printStackTrace();

                frame.setVisible(true);
                return false;
            }

            frame.dispose();
            frame.setUndecorated(true);
            frame.setVisible(true);
            frame.requestFocusInWindow();

            return true;
        }
    }

    log.warn("No screens available or full screen exclusive mode is unsupported on your platform.");

    postError("Full screen mode is not supported on your platform.");

    return false;
}