Reading the java files from the folder
I have developed an application that reads files from the folder chosen by the user. It displays how many lines of code are in each file. I want only Java files to be shown in the file-chooser (files having .java extension). Below is my code: public static void main(String[] args) throws FileNotFoundException { JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File("C:" + File.separator)); chooser.setDialogTitle("FILES ALONG WITH LINE NUMBERS"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser