🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19003

Filer Problem

#19003
From: Laurent LEFEVRE
Date: Sat, 21 Mar 1998 00:00
42 lines
1694 bytes
Hi

I try to filter files in a Filer or a FileDialog
It doesn't seem to works
This is my code


       .....
       Filer filer1 = new Filer(fparent, "S�lection du r�pertoire de
base");
       filer1.setDirectory("c:\");
       EndsWithFilter filtreHtml = new EndsWithFilter(".html");
       filer1.setFilenameFilter(filtreHtml);
       filer1.show();
      ....



public class EndsWithFilter implements FilenameFilter {
      private String extension;

      public EndsWithFilter(String s) {
             this.extension = s;
      }

      public boolean accept(File dir, String name) {
             if (name.endsWith(extension))
                return true;
             else
                return (new File(dir, name)).isDirectory();
      }
}

--
Laurent LEFEVRE
====================================================================
CO2W3         Parc d'activit� P�gase,            Tel : 02.96.05.82.40
              1 rue Fulgence Bienven�e           Fax : 02.96.05.82.41
              22300 LANNION - FRANCE             http://www.co2w3.fr
--------------------------------------------------------------------
 Logiciels Cooperatifs - Services Internet - Materiel Informatique
Technical Details
Message-ID: <3513CBF5.B7D43CEC@co2w3.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,7101d69ff07904ef,start
X-Google-Attributes: gidf74b3,public
From: Laurent LEFEVRE <laurent.lefevre@co2w3.fr>
Subject: Filer Problem
Date: 1998/03/21
Message-ID: <3513CBF5.B7D43CEC@co2w3.fr>
X-Deja-AN: 336263809
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Organization: CO2W3 - Lannion
Newsgroups: borland.public.jbuilder.java.language