public static Image getImage(final String filename) {
		ImageIcon icon;
		final URL url = ImagePanel.class.getResource(filename);
		if (url != null) {
			icon = new ImageIcon(url);
		} else {
			// Read from file.
			icon = new ImageIcon(filename);
			// Try to read from URL.
			if ((icon == null) || (icon.getImageLoadStatus() != MediaTracker.COMPLETE)) {
				try {
					icon = new ImageIcon(new URL(filename));
				} catch (final MalformedURLException murle) {
					// Not a URL.
					return null;
				}
			}
		}
		return icon.getImage();
	}