Class SwingImageIcon

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

    @OpenApiAll
    @Deprecated
    public class SwingImageIcon
    extends javax.swing.ImageIcon
    implements java.io.Serializable, ResizableIcon
    Deprecated.
    Extended version of javax.swing.ImageIcon with some utility methods.
    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
      SwingImageIcon​(byte[] imageData, java.lang.String description)
      Deprecated.
      Construct icon from image data
      SwingImageIcon​(java.awt.Image image)
      Deprecated.
      Constructs a new ImageIcon instance.
      SwingImageIcon​(java.lang.Class clazz, java.lang.String location)
      Deprecated.
      Construct image from resources available to class loader of given class at given location
      SwingImageIcon​(java.lang.Class clazz, java.lang.String location, boolean silent)
      Deprecated.
      Construct image from resources available to class loader of given class at given location
      SwingImageIcon​(java.lang.String file)
      Deprecated.
      Construct image from file
      SwingImageIcon​(java.net.URL url)
      Deprecated.
      Construct image from url
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Deprecated.
      Returns cloned instance of this icon.
      static javax.swing.ImageIcon createImageIcon​(ResizableIcon icon, int width, int height)
      Deprecated.
      Create image icon of given size from given icon
      static javax.swing.ImageIcon createImageIcon​(java.awt.Component component, javax.swing.Icon icon)
      Deprecated.
      Utility method to create an image icon from given icon
      static javax.swing.ImageIcon createImageIcon​(javax.swing.Icon icon, int width, int height)
      Deprecated.
      Create image icon of given size from given icon
      static ResizableIcon createScaledInstance​(ResizableIcon icon, int size)
      Deprecated.
      Utility method to create a scaled instance of given icon
      static javax.swing.Icon createScaledInstance​(javax.swing.Icon icon, int size)
      Deprecated.
      Utility method to create a scaled instance of given icon
      java.lang.String getLocation()
      Deprecated.
       
      java.net.URL getURL()
      Deprecated.
       
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
      Deprecated.
      Draw the icon in the given bounds.
      • 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

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.swing.Icon

        getIconHeight, getIconWidth, paintIcon
    • Constructor Detail

      • SwingImageIcon

        public SwingImageIcon​(java.awt.Image image)
        Deprecated.
        Constructs a new ImageIcon instance.
      • SwingImageIcon

        public SwingImageIcon​(byte[] imageData,
                              java.lang.String description)
        Deprecated.
        Construct icon from image data
        Parameters:
        imageData - image data
        description - description
      • SwingImageIcon

        public SwingImageIcon​(java.lang.String file)
        Deprecated.
        Construct image from file
        Parameters:
        file - file
      • SwingImageIcon

        public SwingImageIcon​(java.net.URL url)
        Deprecated.
        Construct image from url
        Parameters:
        url - url
      • SwingImageIcon

        public SwingImageIcon​(java.lang.Class clazz,
                              java.lang.String location)
        Deprecated.
        Construct image from resources available to class loader of given class at given location
        Parameters:
        clazz - class
        location - location
      • SwingImageIcon

        public SwingImageIcon​(java.lang.Class clazz,
                              java.lang.String location,
                              boolean silent)
        Deprecated.
        Construct image from resources available to class loader of given class at given location
        Parameters:
        clazz - class
        location - location
        silent - if true, does not report to log file about missing icon at given location
    • Method Detail

      • paintIcon

        public void paintIcon​(java.awt.Component c,
                              java.awt.Graphics g,
                              int x,
                              int y,
                              int w,
                              int h)
        Deprecated.
        Description copied from interface: ResizableIcon
        Draw the icon in the given bounds. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.
        Specified by:
        paintIcon in interface ResizableIcon
        Parameters:
        c - the given component.
        g - the graphics to paint on.
        x - x coordinate.
        y - y coordinate.
        w - width to paint.
        h - height to paint.
      • getLocation

        public java.lang.String getLocation()
        Deprecated.
        Returns:
        location
      • getURL

        public java.net.URL getURL()
        Deprecated.
        Returns:
        url
      • clone

        public java.lang.Object clone()
        Deprecated.
        Description copied from interface: ResizableIcon
        Returns cloned instance of this icon.
        Specified by:
        clone in interface ResizableIcon
        Overrides:
        clone in class java.lang.Object
        Returns:
        cloned instance.
      • createScaledInstance

        public static ResizableIcon createScaledInstance​(ResizableIcon icon,
                                                         int size)
        Deprecated.
        Utility method to create a scaled instance of given icon
        Parameters:
        icon - icon
        size - size
        Returns:
        scaled icon
      • createScaledInstance

        public static javax.swing.Icon createScaledInstance​(javax.swing.Icon icon,
                                                            int size)
        Deprecated.
        Utility method to create a scaled instance of given icon
        Parameters:
        icon - icon
        size - size
        Returns:
        scaled icon
      • createImageIcon

        public static javax.swing.ImageIcon createImageIcon​(@CheckForNull
                                                            java.awt.Component component,
                                                            @Nonnull
                                                            javax.swing.Icon icon)
        Deprecated.
        Utility method to create an image icon from given icon
        Parameters:
        component - owner of icon
        icon - icon
        Returns:
        scaled icon
      • createImageIcon

        public static javax.swing.ImageIcon createImageIcon​(javax.swing.Icon icon,
                                                            int width,
                                                            int height)
        Deprecated.
        Create image icon of given size from given icon
        Parameters:
        icon - icon
        width - width
        height - height
        Returns:
        image icon
      • createImageIcon

        public static javax.swing.ImageIcon createImageIcon​(ResizableIcon icon,
                                                            int width,
                                                            int height)
        Deprecated.
        Create image icon of given size from given icon
        Parameters:
        icon - icon
        width - width
        height - height
        Returns:
        image icon