Class ScaledImageLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
ScaledDefaultImageLabel

public class ScaledImageLabel extends JLabel
This is an extended version of a JLabel which draws its icon image using the ImageDrawer utility.
See Also:
Serialized Form
  • Constructor Details

    • ScaledImageLabel

      public ScaledImageLabel()
    • ScaledImageLabel

      public ScaledImageLabel(boolean disableShrink)
    • ScaledImageLabel

      public ScaledImageLabel(boolean disableShrink, boolean disableEnlarge)
    • ScaledImageLabel

      public ScaledImageLabel(Icon image, boolean disableShrink)
  • Method Details

    • isDisableShrink

      public boolean isDisableShrink()
      Returns:
      the disableShrink
    • setDisableShrink

      public void setDisableShrink(boolean disableShrink)
      Parameters:
      disableShrink - the disableShrink to set
    • isDisableEnlarge

      public boolean isDisableEnlarge()
      Returns:
      the disableEnlarge
    • setDisableEnlarge

      public void setDisableEnlarge(boolean disableEnlarge)
      Parameters:
      disableEnlarge - the disableEnlarge to set
    • getImagePosition

      public int getImagePosition()
      Returns:
      the imagePosition
    • setImagePosition

      public void setImagePosition(int imagePosition)
      Parameters:
      imagePosition - the imagePosition to set
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • setImage

      public void setImage(Image image)
    • getImage

      public Image getImage()
    • setImage

      public void setImage(File file) throws IOException
      Set the current image to an image pointed to by this File.
      Parameters:
      file - a File pointing to an image
      Throws:
      IOException - thrown if the image cannot be loaded