Example usage for java.awt Component paintAll

List of usage examples for java.awt Component paintAll

Introduction

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

Prototype

public void paintAll(Graphics g) 

Source Link

Document

Paints this component and all of its subcomponents.

Usage

From source file:Main.java

public static BufferedImage createImage(Component comp) {
    if (comp == null)
        return null;

    BufferedImage image = (BufferedImage) comp.createImage(comp.getWidth(), comp.getHeight());
    Graphics g = image.createGraphics();
    comp.paintAll(g);
    return image;
}