disable Double Buffering - Java 2D Graphics

Java examples for 2D Graphics:Print

Description

disable Double Buffering

Demo Code


//package com.java2s;
import java.awt.*;
import javax.swing.*;

public class Main {
    /**// w w  w  . j  a  va 2s. c  om
     * The speed and quality of printing suffers dramatically if any of the
     * containers have double buffering turned on, so this turns it off
     * globally. This step is only required in JDK 1.2.
     */

    public static void disableDoubleBuffering(Component c) {
        RepaintManager currentManager = RepaintManager.currentManager(c);
        currentManager.setDoubleBufferingEnabled(false);
    }
}

Related Tutorials