>> I let my class implement the FilenameFilter interface and override the
boolean
> > accept(File,String)-method. Even if I let this function return false in
every
> > case, still all files in the directory are displayed. Here is some code:
> >
[quoted text clipped - 11 lines]
> > return a.getFile();
> > }
> Javadoc:
>
[quoted text clipped - 4 lines]
>
> What on Earth where they thinking...
Stupid. I do the file testing by hand now with a variation
of this code. What made the Sun people ommit a proper
implementation of FilenameFilter for Window$?
//open method
String open()
{
java.awt.FileDialog a=new java.awt.FileDialog
(
this,
"Open een .jpg of .img file",
java.awt.FileDialog.LOAD
);
a.setVisible(true);
String b=a.getFile();
if(b.endsWith(".jpg")|b.endsWith(".gif");
else b="";
return b;
}