(+84) 236.3827111 ex. 402

Dùng FileChooser trong GUI


JFileChooser fc = new JFileChooser();
fc.showSaveDialog(null);
String tenFile = fc.getSelectedFile().getPath();
try{
File f = new File(tenFile);
if(!f.exists()){
//PrintStream out = new PrintStream(f);
// XU LY FILE O DAY
//
out.close();
}
else
System.out.println("file da ton tai");
} catch (Exception e) {