All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.ucm.fdi.gaia.jcolibri.method.gui.utils.WindowUtils Maven / Gradle / Ivy

Go to download

jCOLIBRI is a java framework for the development of Case-Based Reasoning systems.

There is a newer version: 3.2
Show newest version
/**
 * WindowUtils.java
 * jCOLIBRI2 framework. 
 * @author Juan A. Recio-Garc�a.
 * GAIA - Group for Artificial Intelligence Applications
 * http://gaia.fdi.ucm.es
 * 24/10/2007
 */
package es.ucm.fdi.gaia.jcolibri.method.gui.utils;

import java.awt.Dimension;

import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 * Utility class to manage windows
 * @author Juan A. Recio-Garcia
 * @version 1.0
 *
 */
public class WindowUtils
{

    public static void centerWindow(JFrame frame)
    {
	Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
	frame.setBounds((screenSize.width - frame.getWidth()) / 2,
		(screenSize.height - frame.getHeight()) / 2, 
		frame.getWidth(),
		frame.getHeight());
    }
    public static void centerWindow(JDialog dialog)
    {
	Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
	dialog.setBounds((screenSize.width - dialog.getWidth()) / 2,
		(screenSize.height - dialog.getHeight()) / 2, 
		dialog.getWidth(),
		dialog.getHeight());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy