1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| import javax.swing.*;
import java.io.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
File extensions = new File("/home/alba/Travail/COO/fichiers-plugins/extensions");
int delay = 1000; //milliseconds
String[] files;
FilenameFilter filter = new FilenameFilter(){
public boolean accept(File dir, String name){
return name.endsWith(".class");
}
};
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
files = extensions.list(filter);
}
};
while(true){
new Timer(delay, taskPerformer).start();
}
}
} |
Partager