Searching files of a particular extension in a folder/

I want to search a folder which contains files of a paricular type say text, then I want want to put list of those files in a combo box according to the search criteria.so plz help me by giving the code of what should bedone.
[239 byte] By [javaIndiaa] at [2007-11-27 2:25:27]
# 1
hi!readFile.list(java.io.FilenameFilter)regardsAniruddha
Aniruddha-Herea at 2007-7-12 2:33:46 > top of Java-index,Desktop,Core GUI APIs...
# 2
thanks for the reply.but i don't know how to use it, how should i specify the name of the folder in which i want to conduct my search
javaIndiaa at 2007-7-12 2:33:46 > top of Java-index,Desktop,Core GUI APIs...
# 3

hi!

File[] l_files = new File("your path").listFiles(new FileFilter() {

public boolean accept(File a_pathName)

{

if(a_pathName.isDirectory())

return false;

if(a_pathName.exists() == false)

return false;

String l_strFileName = a_pathName.getAbsolutePath().toLowerCase();

if(l_strFileName.endsWith("tbl") ||

l_strFileName.endsWith("waf") ||

l_strFileName.endsWith("wbf"))

{

return true;

}

return false;

}

});

regards

Aniruddha

Aniruddha-Herea at 2007-7-12 2:33:46 > top of Java-index,Desktop,Core GUI APIs...
# 4
thanks alot this code is working
javaIndiaa at 2007-7-12 2:33:46 > top of Java-index,Desktop,Core GUI APIs...