-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportSave.java
More file actions
32 lines (24 loc) · 815 Bytes
/
ImportSave.java
File metadata and controls
32 lines (24 loc) · 815 Bytes
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 java.io.IOException;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.filechooser.FileNameExtensionFilter;
public class ImportSave extends JFrame {
private static final long serialVersionUID = 1L;
private String savePath;
private String directory;
public ImportSave() {
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new FileNameExtensionFilter("sauvegarde", "site"));
int returnVal = chooser.showOpenDialog(null);
if(returnVal == JFileChooser.APPROVE_OPTION) {
this.savePath = chooser.getSelectedFile().getAbsolutePath();
this.directory = chooser.getCurrentDirectory().getAbsolutePath();
}
}
public String getSavePath (){
return savePath;
}
public String getDirectory (){
return this.directory;
}
}