This is my code to search for the text file with it's file name.
there is no error in this program but i'm not knowing whether the code is searching properly or not. i want to get the message "file found" if the file exist if not "file not found" in the message dialog box. so any one who have an idea with my difficulties please help me. 

```
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:

    File dir = new File("C:\\Users\\EmuD\\Documents\\NetBeansProjects\\Bank Project");
    File[] matchingFiles = dir.listFiles(new FilenameFilter() {

        public boolean accept(File dir, String name) {
            String search = jTextField1.getText();
            return name.startsWith(search) && name.endsWith(".txt");
        }
    });
}

```

Thanks a lot!!