Java Screen Center moveToScreenCenter(Window w)

Here you can find the source of moveToScreenCenter(Window w)

Description

move To Screen Center

License

LGPL

Declaration

public static void moveToScreenCenter(Window w) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static void moveToScreenCenter(Window w) {
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        w.setLocation((screen.width - w.getWidth()) / 2,
                (screen.height - w.getHeight()) / 2);
    }/*from   w  w w .j  a va 2  s  . c om*/
}

Related

  1. getFrameOnCenterLocationPoint(Window window)
  2. getLocationToCenterOnScreen(Component comp)
  3. getPercentageOnScreen(Point location, Dimension size, Rectangle screen)
  4. locateOnScreenCenter(Component component)
  5. moveToCenter(Component componentToMove, Component componentToCenterOver)
  6. packAndCenter(Window wind)
  7. packAndCenter(Window window)
  8. screenCenter(Window window)
  9. setCenter(Component comp)