FileDialog.setFilenameFilter()



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:

//open method
String open()
{
java.awt.FileDialog a=new java.awt.FileDialog
(
frame,
"Open een .jpg of .img file",
java.awt.FileDialog.LOAD
);
a.setFilenameFilter(this);
a.setVisible(true);
return a.getFile();
}




//accept, doesn't work
public boolean accept(java.io.File a,String b)
{
return false;
}






.



Relevant Pages

  • Re: Arriving to max field size
    ... not convert boolean to string". ... > in the override KeyPress procedure. ... > DBGrid1: TDBGrid; ...
    (borland.public.delphi.database.ado)
  • Re: Arraylist searching question
    ... How could I override the sort ... I dont really understand why I would override the GetHashCode function ... > Public Overloads Overrides Function EqualsAs Boolean ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How can I make a property not show in the properties window?
    ... If you want to "override" the *attributes* of a not overridable property. ... >> Public Shadows Property AutoScroll() As Boolean ... >> Public Overrides Property AutoScroll() As Boolean ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ruby and true
    ... comparing with just one of these values will almost certainly make your ... consider that none of the following are the boolean value ... has truthiness if it doesn't compare equal to zero; this makes null pointers ... away with some idiotic hack to override a particular object's hypothetical ...
    (comp.lang.ruby)
  • Re: sortout things from an array
    ... So that means you cant emit your closer right way, ... You have to set a boolean when you start a ... Prev by Date: ...
    (comp.lang.java.help)