| | |
JFilerChooser default filefilter
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Well surely the default filter must be *.*.
Which I would imagine was derived from a regular expression? But I don't have my java compiler at hand to test that. And the API for JFilterChooser may not include that.
Which I would imagine was derived from a regular expression? But I don't have my java compiler at hand to test that. And the API for JFilterChooser may not include that.
Last edited by iamthwee; Mar 24th, 2007 at 12:52 pm.
*Voted best profile in the world*
http://www.particle.kth.se/~lindsey/...9/chooser.html
Perhaps? Untested. Although I'd imagine it to be something along those lines?
import javax.swing.*;
import java.io.*;
/** Filter to work with JFileChooser to select java file types. **/
public class JavaFilter extends javax.swing.filechooser.FileFilter
{
public boolean accept (File f) {
return f.getName ().toLowerCase ().endsWith ("*.*")
|| f.isDirectory ();
}
public String getDescription () {
return "Java files (*.*)";
}
} // class JavaFilterPerhaps? Untested. Although I'd imagine it to be something along those lines?
*Voted best profile in the world*
very interesting website...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- Default program to open *.pdf (Mac Software)
- Default Home page setting changed (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: JNDI/JDBC lookup problem with Sun Java Application Server 8.2
- Next Thread: help plss..emergency.
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary bluetooth character chat class classes client code component consumer csv database desktop draw eclipse error event exception fractal ftp game givemetehcodez graphics gui html ide image input integer j2me japplet java javaarraylist javaee javaprojects jmf jni jpanel julia linked linux list loop mac map method methods mobile netbeans newbie objects online oracle oriented panel print printf problem program programming project projects properties recursion replaydirector reporting researchinmotion robot rotatetext rsa scanner screen se server set size sms sort sql string swing template test threads time tree ubuntu windows working






