Results 1 to 3 of 3

Thread: File

  1. #1
    Punter is offline Member
    Join Date
    Feb 2009
    Rep Power

    Lightbulb File

    Hi ...
    I want to allow the user to search files according to filename
    eg User should be able to search files having "N97" in the filename

    How shud I do this???

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    Read the API docs for File, and it's getName() and listFiles() methods, and implement those in a recursive method.

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power


    Look at JFileChoose and its setFileFilter() method. Creating a FileFilter is actually very easy. That will do exactly what you want with almost no programming.

Similar Threads

  1. count character in text file as input file
    By aNNuur in forum New To Java
    Replies: 7
    Last Post: 03-25-2010, 04:01 PM
  2. Replies: 2
    Last Post: 04-07-2009, 06:25 AM
  3. Replies: 7
    Last Post: 11-19-2008, 02:09 PM
  4. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 09:57 AM
  5. Replies: 7
    Last Post: 05-23-2008, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts