Example usage for javax.swing JPanel setDoubleBuffered

List of usage examples for javax.swing JPanel setDoubleBuffered

Introduction

In this page you can find the example usage for javax.swing JPanel setDoubleBuffered.

Prototype

public void setDoubleBuffered(boolean aFlag) 

Source Link

Document

Sets whether this component should use a buffer to paint.

Usage

From source file:com.limegroup.gnutella.gui.notify.AnimatedWindow.java

@Override
public void setContentPane(Container contentPane) {
    this.contentPane = contentPane;
    JPanel panel = new JPanel(new BorderLayout()) {
        /**// w  w  w. j a  va  2 s.c om
         * 
         */
        private static final long serialVersionUID = 1025231305407376307L;

        @Override
        public void paint(Graphics g) {
            if (animationImage != null && isAnimationInProgress()) {
                mode.paint(AnimatedWindow.this, g, backgroundImage, animationImage);
            } else {
                super.paint(g);
            }
        }
    };
    panel.setDoubleBuffered(true);
    panel.add(contentPane, BorderLayout.CENTER);
    super.setContentPane(panel);
}