[SWT]子ウィンドウを親ウィンドウの中心にする
/** * 子ウィンドウを親ウィンドウの中心にする. * @param shell * @param parent */ public static void setCenter(Shell shell, Shell parent) { Point size = shell.getSize(); Point psize = parent.getSize(); Point pos = parent.getLocation(); shell.setLocation(pos.x + (psize.x - size.x) /2, pos.y + (psize.y - size.y) / 2); }