Example usage for javax.swing JFrame setIgnoreRepaint

List of usage examples for javax.swing JFrame setIgnoreRepaint

Introduction

In this page you can find the example usage for javax.swing JFrame setIgnoreRepaint.

Prototype

public void setIgnoreRepaint(boolean ignoreRepaint) 

Source Link

Document

Sets whether or not paint messages received from the operating system should be ignored.

Usage

From source file:Main.java

private static void doDisableActiveRenderingInEDT(final JFrame jFrame) {
    jFrame.getRootPane().setOpaque(true);
    jFrame.setFocusTraversalKeysEnabled(true);
    jFrame.setIgnoreRepaint(false);

    doSetIgnoreRepaint(jFrame, false);/*from w w  w  .  j av a  2s  .c om*/
}

From source file:Filter3dTest.java

/**
 * Enters full screen mode and changes the display mode. If the specified
 * display mode is null or not compatible with this device, or if the
 * display mode cannot be changed on this system, the current display mode
 * is used.//from  w ww  . j a  v a  2  s .co  m
 * <p>
 * The display uses a BufferStrategy with 2 buffers.
 */
public void setFullScreen(DisplayMode displayMode) {
    final JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setUndecorated(true);
    frame.setIgnoreRepaint(true);
    frame.setResizable(false);

    device.setFullScreenWindow(frame);

    if (displayMode != null && device.isDisplayChangeSupported()) {
        try {
            device.setDisplayMode(displayMode);
        } catch (IllegalArgumentException ex) {
        }
        // fix for mac os x
        frame.setSize(displayMode.getWidth(), displayMode.getHeight());
    }
    // avoid potential deadlock in 1.4.1_02
    try {
        EventQueue.invokeAndWait(new Runnable() {
            public void run() {
                frame.createBufferStrategy(2);
            }
        });
    } catch (InterruptedException ex) {
        // ignore
    } catch (InvocationTargetException ex) {
        // ignore
    }

}