Article View: borland.public.jbuilder.java.language
Article #19011Re: Filer Problem
From: Rich Wilkman
Date: Mon, 23 Mar 1998 00:00
Date: Mon, 23 Mar 1998 00:00
65 lines
2582 bytes
2582 bytes
Laurent:
FileNameFilter doesn't work with Filer dialogs on the Win32
implementations of Java. Been that way for a very long time and I
don't know if Sun is gonna fix it before 1.2. Best workaround is to
set the filename to *.html.
-Rihc
Laurent LEFEVRE wrote:
>
> 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
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team
If you see something that looks like an opinion up there,
it's mine and mine alone.
Mail sent to me from the newsgroups won't bounce but will
be ignored. If I have time, I'll respond, but you have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<351694C0.E4F38FCF@corp.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3513CBF5.B7D43CEC@co2w3.fr>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,7101d69ff07904ef X-Google-Attributes: gidf74b3,public From: Rich Wilkman <rwilkman@corp.borland.com> Subject: Re: Filer Problem Date: 1998/03/23 Message-ID: <351694C0.E4F38FCF@corp.borland.com> X-Deja-AN: 336868195 Content-Transfer-Encoding: 8bit References: <3513CBF5.B7D43CEC@co2w3.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language