Class ImagePreview

    • Field Detail

      • m_Owner

        protected JFileChooser m_Owner
        the owning filechooser.
      • m_PreviewWidth

        protected int m_PreviewWidth
        the width of the preview.
      • m_PreviewHeight

        protected int m_PreviewHeight
        the height of the preview.
      • m_Thumbnail

        protected ImageIcon m_Thumbnail
        the thumbnail.
      • m_File

        protected File m_File
        the thumbnail.
    • Constructor Detail

      • ImagePreview

        public ImagePreview​(JFileChooser owner)
        Initializes the preview panel with a default size of 100x50 pixels.
        Parameters:
        owner - the owning file chooser
      • ImagePreview

        public ImagePreview​(JFileChooser owner,
                            int width,
                            int height)
        Initializes the preview panel with a default size of 100x50 pixels.
        Parameters:
        owner - the owning file chooser
        width - the width of the preview
        height - the height of the preview
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
      • getOwner

        public JFileChooser getOwner()
        Returns the owning filechooser instance.
        Returns:
        the owner
      • loadImage

        protected void loadImage()
        Loads the image.
      • paintComponent

        protected void paintComponent​(Graphics g)
        Displays the image.
        Overrides:
        paintComponent in class JComponent
        Parameters:
        g - the graphics context
      • showImage

        protected void showImage()
        Shows the current thumbnail as full-size image in a new dialog.