Please tell me the meaning and purpose of "filter" in the method below. Can this be used to search for desired files using a "filter" like : "list files that begin with only B or B" etc...(i need such a feature for one of my kiddie projects)
File listFiles(FileFilter filter)
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.
You need to extend/implement the interface- FileFilter and override the accept method. It would work the same way for the console output as well. Just that you dont use JFileChooser for file listing instead explore the File API.