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.*;

public class Main {
    public static void printNow(int time, JComponent obj) {
        Dimension dim = obj.getSize();
        obj.validate();
        obj.paintImmediately(0, 0, dim.width, dim.height);
        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
        }
    }
}