aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/FileUtility.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/FileUtility.java')
-rw-r--r--src/main/java/FileUtility.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/FileUtility.java b/src/main/java/FileUtility.java
index cc0dffb..73178ae 100644
--- a/src/main/java/FileUtility.java
+++ b/src/main/java/FileUtility.java
@@ -118,6 +118,20 @@ public class FileUtility {
}
}
}
+
+ public static String showImageFileChooser() {
+ javax.swing.JFileChooser chooser = new javax.swing.JFileChooser();
+ FileNameExtensionFilter filter = new FileNameExtensionFilter("JPEG Image File", "jpg", "jpeg");
+ chooser.setFileFilter(filter);
+ chooser.setDialogTitle("Select a image file");
+ chooser.setFileSelectionMode(javax.swing.JFileChooser.FILES_ONLY);
+ chooser.setAcceptAllFileFilterUsed(false);
+ if (chooser.showOpenDialog(null) == javax.swing.JFileChooser.APPROVE_OPTION) {
+ return chooser.getSelectedFile().getAbsolutePath();
+ } else {
+ return null;
+ }
+ }
public static ArrayList<String> txtToArrayList(String fileName) {
ArrayList<String> lines = new ArrayList<String>();
try {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage