01: package com.opensymphony.workflow.designer.swing;
02:
03: import java.awt.Dimension;
04: import java.awt.Toolkit;
05: import java.awt.Window;
06:
07: /**
08: * @author Gulei
09: */
10: public class ScreenUtils {
11: public static void center(Window frame) {
12: Dimension screenSize = Toolkit.getDefaultToolkit()
13: .getScreenSize();
14: Dimension frameSize = frame.getSize();
15: frame.setLocation(screenSize.width / 2 - (frameSize.width / 2),
16: screenSize.height / 2 - (frameSize.height / 2));
17: }
18:
19: }
|