23 package com.realtime.crossfire.jxclient.util;
25 import java.io.IOException;
27 import javax.swing.ImageIcon;
28 import org.jetbrains.annotations.NotNull;
79 public static ImageIcon
loadImage(@NotNull
final String name)
throws IOException {
80 final URL url =
ResourceUtils.class.getClassLoader().getResource(
"resource/"+name);
82 throw new IOException(
"cannot find image '"+name+
"'");
84 final ImageIcon imageIcon =
new ImageIcon(url);
85 if (imageIcon.getIconWidth() <= 0 || imageIcon.getIconHeight() <= 0) {
86 throw new IOException(
"cannot load image '"+name+
"'");