|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
JFileFilter
public class JFileFilter
class JFileFilter A simple FileFilter class that works by filename extension, like one in JDK demo called ExtentionFilter to be released in future Swing. Based on code from p 393 in Java Cookbook by Ian Darwin, O'Reilly INC, 2001. Used with permission. Source for entire text can be downloaded at http://javacook.darwinsys.com. 11 December 2001 Revised: 14 December 2001 by Victor Spears implemented by James Harney for Cole Terrorist Attack Project.
| Field Summary | |
|---|---|
protected java.lang.String |
description
|
protected java.util.ArrayList |
exts
|
| Constructor Summary | |
|---|---|
JFileFilter()
|
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File f)
Tells whether the file is acceptable; either a directory or a file with an extension from the ArrayList exts (set with addType()) |
void |
addType(java.lang.String s)
adds a new file extension to the list of those allowable |
java.lang.String |
getDescription()
gets the description string for the file types desired. |
void |
setDescription(java.lang.String s)
Sets the description string for the file types desired. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String description
protected java.util.ArrayList exts
| Constructor Detail |
|---|
public JFileFilter()
| Method Detail |
|---|
public void addType(java.lang.String s)
s - the new allowable extension. Once added, the 'accept' method will
return true for files with this extensionpublic boolean accept(java.io.File f)
accept in class javax.swing.filechooser.FileFilterf - file to be queried
public void setDescription(java.lang.String s)
s - Desired description of the file types allowedpublic java.lang.String getDescription()
getDescription in class javax.swing.filechooser.FileFilter
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||