Class ExtensionFileFilter


  • public class ExtensionFileFilter
    extends javax.swing.filechooser.FileFilter
    A FileFilter that will only accept files of a certain extension.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String desc  
      private java.lang.String[] extensions  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtensionFileFilter​(java.lang.String[] ext, java.lang.String description)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.io.File pathname)
      java.lang.String getDescription()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • extensions

        private java.lang.String[] extensions
      • desc

        private final java.lang.String desc
    • Constructor Detail

      • ExtensionFileFilter

        public ExtensionFileFilter​(java.lang.String[] ext,
                                   java.lang.String description)
        Constructor.
        Parameters:
        ext - A list of filename extensions, ie new String[] { "PDF"}.
        description - A description of the files.
    • Method Detail

      • accept

        public boolean accept​(java.io.File pathname)
        Specified by:
        accept in class javax.swing.filechooser.FileFilter
      • getDescription

        public java.lang.String getDescription()
        Specified by:
        getDescription in class javax.swing.filechooser.FileFilter