标题: 求解释 [打印本页] 作者: 15114111253 时间: 2016-8-4 19:49 标题: 求解释 public class GUITool {
static Toolkit kit = Toolkit.getDefaultToolkit();
public static void center(Component c) {
int x = (kit.getScreenSize().width - c.getWidth()) / 2;
int y = (kit.getScreenSize().height - c.getHeight()) / 2;
c.setLocation(x, y);
}
public static void setTitleImage(JFrame frame,String titleIconPath) {
frame.setIconImage(kit.createImage(titleIconPath));
}
}