1 package com.darwinsys.util;
2
3 import java.awt.*;
4
5
6
7
8 public class UtilGUI {
9
10 public static void centre(Window w) {
11
12 Dimension us = w.getSize();
13 Dimension them = Toolkit.getDefaultToolkit().getScreenSize();
14 int newX = (them.width - us.width) / 2;
15 int newY = (them.height - us.height) / 2;
16 w.setLocation(newX, newY);
17 }
18
19
20
21
22 public static void center(Window w) {
23 UtilGUI.centre(w);
24 }
25
26
27 public static void maximize(Window w) {
28 Dimension them = Toolkit.getDefaultToolkit().getScreenSize();
29 w.setBounds(0, 0, them.width, them.height);
30 }
31 }
CategoryJava
ZbmonWiki: UtilGUI.java (2005-11-07 13:41:15에 zbmon가(이) 마지막으로 수정)