Results 1 to 3 of 3

Thread: File

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

    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
    Posts
    2,571
    Rep Power
    9

    Default

    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
    Posts
    1,046
    Rep Power
    7

    Default

    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, 05:01 PM
  2. Replies: 2
    Last Post: 04-07-2009, 07:25 AM
  3. Replies: 7
    Last Post: 11-19-2008, 03: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, 10:57 AM
  5. Replies: 7
    Last Post: 05-23-2008, 04: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
  •