Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.ArrayList;

public class Main {

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

            dbcomponents.add(jcomponent);
            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);
                }
            }
        }
    }
}