首页>代码>Java swing简单个人信息管理器>/People/src/com/text1/GUIUtil.java
package com.text1;

import java.awt.Component;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;

public class GUIUtil {
    public static void toCenter(Component comp) {
        GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
        Rectangle rec=ge.getDefaultScreenDevice().getDefaultConfiguration().getBounds();
        comp.setLocation(((int)(rec.getWidth()-comp.getWidth())/2),
                ((int)(rec.getHeight()-comp.getHeight()))/2);

    }
}
最近下载更多
YZN111  LV3 2023年12月12日
1219610676  LV4 2023年12月7日
yangxb2  LV10 2023年10月20日
linmou  LV8 2023年3月13日
朱俪的邮件及存储  LV8 2023年2月27日
Willson88888  LV3 2022年12月7日
奶油味儿的小透明  LV1 2022年12月5日
VIOLENTIO  LV1 2022年11月8日
闫小玥  LV8 2021年12月22日
Undead  LV2 2021年12月14日
最近浏览更多
uid0901  LV2 3月14日
lshlsh 2023年12月25日
暂无贡献等级
shiaomon 2023年12月14日
暂无贡献等级
YZN111  LV3 2023年12月12日
1219610676  LV4 2023年12月7日
李朝磊  LV18 2023年11月18日
121231 2023年11月9日
暂无贡献等级
yangxb2  LV10 2023年10月20日
卢本伟不开挂  LV4 2023年9月14日
榆安安 2023年6月25日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友