textbender.o.swing
Class ImageIconX

java.lang.Object
  extended by ImageIconX

public class ImageIconX
extends Object

Image icon utilities.

Thread safe.


Method Summary
static ImageIcon tryCreate(String filename, int size)
          Tries to create an image icon from a file.
static ImageIcon tryCreate(String filename, int width, int height)
          Tries to create an image icon from a file.
static ImageIcon tryCreate(URL url, int size)
          Tries to create an image icon from a URL.
static ImageIcon tryCreate(URL url, int width, int height)
          Tries to create an image icon from a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

tryCreate

public static ImageIcon tryCreate(String filename,
                                  int size)
Tries to create an image icon from a file.

Parameters:
filename - of image
size - square size expected for the image
Returns:
image icon created from the file; or the defaultImage scaled to the expected size

tryCreate

public static ImageIcon tryCreate(String filename,
                                  int width,
                                  int height)
Tries to create an image icon from a file.

Parameters:
filename - of image
width - expected for the image
height - expected for the image
Returns:
image icon created from the file; or the defaultImage scaled to the expected size

tryCreate

public static ImageIcon tryCreate(URL url,
                                  int size)
Tries to create an image icon from a URL.

Parameters:
url - of image, or null
size - square size expected for the image
Returns:
image icon created from the URL; or the defaultImage scaled to the expected size

tryCreate

public static ImageIcon tryCreate(URL url,
                                  int width,
                                  int height)
Tries to create an image icon from a URL.

Parameters:
url - of image, or null
width - expected for the image
height - expected for the image
Returns:
image icon created from the URL; or the defaultImage scaled to the expected size