Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

import java.awt.Dimension;

import java.awt.Window;

public class Main {
    /**
     *
     * @deprecated  Use automatic RitDialog centering facilities
     */
    public static void centerWindowOnScreen(Window window) {
        Dimension dim = window.getToolkit().getScreenSize();
        window.setLocation((dim.width - window.getWidth()) / 2, (dim.height - (window.getHeight())) / 2);
    }
}