Class ImagePreview

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener

public class ImagePreview extends JComponent implements PropertyChangeListener
JComponent that is used to preview an image file.
See Also:
  • Field Details

    • DEFAULT_IMAGE_PREVIEW

      public static final boolean DEFAULT_IMAGE_PREVIEW
      The default setting for whether to generate an image preview thumbnail.
      See Also:
  • Constructor Details

    • ImagePreview

      public ImagePreview(JFileChooser fc)
      Creates a new ImagePreview.
      Parameters:
      fc - the JFileChooser in which the ImagePreview will be shown.
  • Method Details

    • getPreferredImagePreview

      public static boolean getPreferredImagePreview()
      Returns the user's preference for whether to generate an image preview thumbnail.
      Returns:
      the user's preference for whether to generate an image preview thumbnail.
    • savePreferredImagePreview

      public static void savePreferredImagePreview(boolean b)
      Saves the user's preference for whether to generate an image preview thumbnail.
      Parameters:
      b - the user's new preference for whether to generate an image preview thumbnail.
    • getPreferredSize

      public Dimension getPreferredSize()
      Returns the preferred size of this component.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      the preferred size of this component.
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Signals that a selected folder or file has changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - the PropertyChangeEvent to which to respond.
    • paintComponent

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