public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Test.createAndShowGUI();
}
});
class Filter extends javax.swing.filechooser.FileFilter {
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
return f.getName().endsWith(".java");
}
public String getDescription() {
return "*.java";
}
}
JFileChooser chooser = new JFileChooser();
chooser.addChoosableFileFilter(new Filter());
chooser.showOpenDialog(null);
}