Methods Summary |
---|
public java.lang.String | getDescription(java.io.File f)
return "a description";
|
public javax.swing.Icon | getIcon(java.io.File f)
return null;
|
public java.lang.String | getName(java.io.File f)
String name = f.getName();
int lastdot = name.lastIndexOf('.");
if (lastdot == -1) return name;
else return name.substring(0, lastdot);
|
public java.lang.String | getTypeDescription(java.io.File f)
String name = f.getName();
int lastdot = name.lastIndexOf('.");
if (lastdot != -1) return name.substring(lastdot+1);
else return null;
|
public java.lang.Boolean | isTraversable(java.io.File f)
return null;
|
public static void | main(java.lang.String[] args)
JFileChooser fc = new JFileChooser();
fc.setFileView(new TestFileView());
int result = fc.showOpenDialog(new JFrame());
if (result == JFileChooser.APPROVE_OPTION) {
File f = fc.getSelectedFile();
if (f != null) {
System.out.println(f);
}
}
System.exit(0);
|