Class ResourceIcon

  • All Implemented Interfaces:
    java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon

    public class ResourceIcon
    extends javax.swing.ImageIcon
    Version:
    $Revision: 1.20 $
    Author:
    $author$
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.ImageIcon

        javax.swing.ImageIcon.AccessibleImageIcon
    • Field Summary

      • Fields inherited from class javax.swing.ImageIcon

        component, tracker
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceIcon​(java.lang.Class cls, java.lang.String image)
      Creates a new ResourceIcon object.
      ResourceIcon​(java.lang.String imageName)
      Deprecated.
      Having this available is now bad practice since most of our software is plugable; each class requesting a resource should do so from the class loader that loaded the class, to keep track of images a class should also not be requesting a resource that is outside its own package.
      ResourceIcon​(java.net.URL url)
      Creates a new ResourceIcon object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void loadImage​(java.lang.String imageName)  
      • Methods inherited from class javax.swing.ImageIcon

        getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ResourceIcon

        public ResourceIcon​(java.lang.Class cls,
                            java.lang.String image)
        Creates a new ResourceIcon object.
        Parameters:
        cls -
        image -
      • ResourceIcon

        public ResourceIcon​(java.net.URL url)
        Creates a new ResourceIcon object.
        Parameters:
        url -
      • ResourceIcon

        public ResourceIcon​(java.lang.String imageName)
        Deprecated.
        Having this available is now bad practice since most of our software is plugable; each class requesting a resource should do so from the class loader that loaded the class, to keep track of images a class should also not be requesting a resource that is outside its own package. For resources outside of a package, we should think about creating static helper class to store them. Use the ResourceIcon(Class cls, String image) constructor instead providing the class instance of the class using the image.
        Creates a new ResourceIcon object.
        Parameters:
        imageName -
    • Method Detail

      • loadImage

        protected void loadImage​(java.lang.String imageName)
        Parameters:
        imageName -