- Oct 13, 2011
- 6
- 0
- 0
By the time my post was posted I had moved on to a new problem, the first problem I knew something was wrong but this one works fine in other areas but there are 2 errors bolded in the code below that I don't understand:
Code:
FilenameFilter filter = new FilenameFilter()
[B] [U]{[/U][/B]
public boolean accept(File dir, String name)
{
if (name.contains("."))
{
int i = name.lastIndexOf(".");
String extention = name.substring(i, name.length());
if (extention.equals(".txt"))
{
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
[B][U]}[/U][/B];
Last edited: