JDK-4062249 : FilenameFilter doesn't work with FileDialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95,windows_nt
  • CPU: x86
  • Submitted: 1997-06-30
  • Updated: 1998-01-29
  • Resolved: 1998-01-29
Related Reports
Duplicate :  
Duplicate :  
Description

Name: sgC58550			Date: 06/30/97


public class MyFrame extends Frame implements FilenameFilter
{
    // Constructors and other code go here ...

    public testDialog()
    {
        FileDialog dialog;
        dialog = new FileDialog(this, "title", FileDialog.LOAD);
        dialog.setFilenameFilter(this);
        dialog.show();
    }

    public boolean accept(File dir, String name)
    {
        return name.endsWith(".txt");
    }
}

In my testing, accept() never gets called.  Also, it makes no
difference whether dialog.addNotify() is called before setting
the filename filter.

company - (none) , email - ###@###.###
======================================================================
daniel.indrigo@Canada 1997-08-26 Also fails on Solaris

Comments
WORK AROUND Name: sgC58550 Date: 06/30/97 ======================================================================
11-06-2004