I've written code to open and read individual files (of specific filetypes) but now need to do the same, only with a folder full of these files. I've found this question but I have no idea how to change it around for what I need.
Here's my current code.
    JFileChooser inFileName = new JFileChooser(new 
    File("C:\\Documents and Settings\\lucey01\\Desktop\\Projects\\C0048817\\KOI\\C0048817_PCF_Front"));       
    \\This is the default folder
    FileNameExtensionFilter filter = new FileNameExtensionFilter("PCF & TXT Files", "pcf", "txt");
    inFileName.setFileFilter(filter);
    
    Component parent = null;
    
    do {
      returnVal1 = inFileName.showOpenDialog(parent);
      if (returnVal1 == JFileChooser.CANCEL_OPTION) {
          returnVal2 = JOptionPane.showConfirmDialog(null, "Select YES to cancel. Select NO to restart",
          "Are you sure?", JOptionPane.YES_NO_OPTION);
          if (returnVal2 == JOptionPane.YES_OPTION) {
            System.exit(returnVal2);
            }else{
             checksumGUI.this.askDirectory();
           }
      }
   } while (returnVal1 == JOptionPane.CANCEL_OPTION);
     cf.HexFinder(inFileName,null,null,null);
EDIT So my question is: Is there any (small) thing I can add/change to this code to get it to work on multiple files of specific types in a folder?
Any help is much appreciated, thanks.
 
    