 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
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+
"'");
static final String UNKNOWN_PNG
The resource name of the "unknown" face.
static ImageIcon loadImage(@NotNull final String name)
Loads an image file.
static final String APPLICATION_ICON
The resource name for the application icon.
static final String ALL_SPELL_SKILLS_ICON
The resource name for the default skill face.
static final String PREV_GROUP_FACE
The resource for "Click here for previous group of items" buttons.
ResourceUtils()
Private constructor to prevent instantiation.
static final String NEXT_GROUP_FACE
The resource for "Click here for next group of items" buttons.
Utility class for loading information from resources.