package util;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

public class GameUtil {

    //工具类通常会将构造方法私有
    private GameUtil(){

    }

    public static Image getImage(String path) {
        URL u= GameUtil.class.getClassLoader().getResource(path);
        BufferedImage img=null;

        try {
            img= ImageIO.read(u);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return img;
    }
}
最近下载更多
ClydeSon  LV5 2023年12月27日
1474371745  LV1 2023年12月23日
微信网友_6699076084797440  LV7 2023年10月30日
lsglsg9  LV22 2022年9月27日
uuuuuu1  LV1 2022年6月3日
姜广坤  LV14 2022年5月21日
二十  LV1 2021年12月8日
15661649928  LV1 2020年12月12日
jrh947869206  LV4 2020年12月7日
Zcjiayouya  LV1 2020年9月6日
最近浏览更多
ClydeSon  LV5 2023年12月27日
1474371745  LV1 2023年12月23日
iceworld 2023年11月30日
暂无贡献等级
1112WHQ  LV7 2023年11月3日
微信网友_6699076084797440  LV7 2023年10月30日
大白8加3  LV1 2023年8月18日
W1234561 2023年7月18日
暂无贡献等级
3210619837 2023年6月23日
暂无贡献等级
小安同学  LV7 2023年5月11日
wind12 2023年3月26日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友