Example usage for java.awt Component isDoubleBuffered

List of usage examples for java.awt Component isDoubleBuffered

Introduction

In this page you can find the example usage for java.awt Component isDoubleBuffered.

Prototype

public boolean isDoubleBuffered() 

Source Link

Document

Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later.

Usage

From source file:Main.java

public static void disableBuffer(Component comp, ArrayList<JComponent> dbcomponents) {
    if ((comp instanceof JComponent) && comp.isDoubleBuffered()) {
        JComponent jcomponent = (JComponent) comp;

        dbcomponents.add(jcomponent);/*from ww w .  j  a v  a2  s .  c o m*/
        jcomponent.setDoubleBuffered(false);
    }

    if (comp instanceof Container) {
        Container container = (Container) comp;
        int count = container.getComponentCount();

        if (count > 0) {
            for (int i = 0; i < count; i++) {
                Component component = container.getComponent(i);

                disableBuffer(component, dbcomponents);
            }
        }
    }
}