1 package fr.ove.utils;
2
3 import javax.swing.JFileChooser;
4 import java.awt.Component;
5 import java.io.File;
6
7 /***
8 * A file chooser.
9 */
10 public class FileChooser extends JFileChooser {
11 /***
12 *
13 */
14 private Component compReference = null;
15
16 /***
17 * The Constructor.
18 */
19 public FileChooser() {
20 this(null);
21 }
22
23 /***
24 * The Constructor.
25 */
26 public FileChooser(Component compReference) {
27 super();
28 this.compReference = compReference;
29 }
30
31 /***
32 * Pops the instance for opening a file.
33 */
34 public int showOpen() {
35 return showOpenDialog(compReference);
36 }
37
38 /***
39 * Pops the instance for saving a file.
40 */
41 public int showSave() {
42 return showSaveDialog(compReference);
43 }
44
45 /***
46 *
47 */
48 public void setCompReference(Component compReference) {
49 this.compReference = compReference;
50 }
51
52 /***
53 *
54 */
55 public Component getCompReference() {
56 return compReference;
57 }
58 }