Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.Dimension;

import java.awt.Toolkit;
import java.awt.Window;

public class Main {
    /** GUI utility (set frame on the center of screen) */
    public static void setCenter(Window w) {
        Dimension scSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension wndSize = w.getSize();
        w.setLocation((scSize.width - wndSize.width) / 2, (scSize.height - wndSize.height) / 2);
    }
}