Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.Component;
import java.awt.Container;

import java.awt.Dimension;

public class Main {
    /**
     * Create a component buffer of width w and height h
     * 
     * @param width
     * @param height
     * @return
     */
    public static Component createBufferPanel(int width, int height) {
        Container buffer = new Container();
        buffer.setMinimumSize(new Dimension(width, height));
        buffer.setPreferredSize(new Dimension(width, height));
        buffer.setMaximumSize(new Dimension(width, height));

        return buffer;
    }
}