SAE21_2023/EssaiChoixFichier.java

15 lines
399 B
Java
Raw Normal View History

2024-04-30 13:51:32 +02:00
import java.io.File;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.io.IOException;
import javax.swing.JFileChooser;
class EssaiChoixFichier {
public static void main(String[] arg) throws IOException {
JFileChooser dialogue = new JFileChooser(new File("."));
if (dialogue.showOpenDialog(null)==JFileChooser.APPROVE_OPTION) {
dialogue.getSelectedFile();
}
}
}