Class MultiResolutionIcon

    • Constructor Detail

      • MultiResolutionIcon

        public MultiResolutionIcon​(String resourceName,
                                   Class<?> klass)
                            throws FileNotFoundException
        Lazily creates a multi-resolution icon from the given resource and package.
        Parameters:
        resourceName - resource name
        klass - class which package should be searched
        Throws:
        FileNotFoundException - if no corresponding resource can be found
      • MultiResolutionIcon

        public MultiResolutionIcon​(Image... images)
        Parameters:
        images - images with HiDPI scale factors 1, 2, 4, 8, etc.
    • Method Detail

      • getImages

        public Image[] getImages()
      • getIconWidth

        public int getIconWidth()
        Specified by:
        getIconWidth in interface Icon
      • getIconHeight

        public int getIconHeight()
        Specified by:
        getIconHeight in interface Icon
      • getDescription

        public String getDescription()
        Gets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image. The description may be null.
        Returns:
        a brief textual description of the image
      • setDescription

        public void setDescription​(String description)
        Sets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.
        Parameters:
        description - a brief textual description of the image
      • toString

        public String toString()
        Returns a string representation of this image.
        Overrides:
        toString in class Object
        Returns:
        a string representing this image
      • getAccessibleContext

        public AccessibleContext getAccessibleContext()
        Gets the AccessibleContext associated with this ImageIcon. For image icons, the AccessibleContext takes the form of an AccessibleImageIcon. A new AccessibleImageIcon instance is created if necessary.
        Specified by:
        getAccessibleContext in interface Accessible
        Returns:
        an AccessibleImageIcon that serves as the AccessibleContext of this ImageIcon