Example usage for javax.swing JComponent paintImmediately

List of usage examples for javax.swing JComponent paintImmediately

Introduction

In this page you can find the example usage for javax.swing JComponent paintImmediately.

Prototype

public void paintImmediately(int x, int y, int w, int h) 

Source Link

Document

Paints the specified region in this component and all of its descendants that overlap the region, immediately.

Usage

From source file:Main.java

public static void printNow(int time, JComponent obj) {
    Dimension dim = obj.getSize();
    obj.validate();//w w  w .ja v  a  2 s . com
    obj.paintImmediately(0, 0, dim.width, dim.height);
    try {
        Thread.sleep(time);
    } catch (InterruptedException e) {
    }
}