summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/gui
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-04-06 13:50:00 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-04-06 13:50:00 -0400
commit79d3a4a47cbc1fcf17c77c6fc12ff826a3077bac (patch)
treea69e533c558326d583b3aee891fc815208c7b650 /BJC-Utils2/src/main/java/bjc/utils/gui
parent4355418164c44170cfb329fcbb7e6f1358c0e314 (diff)
Minor bugfixes/changes, as well as beginnings of CLI systems
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/gui/SimpleDialogs.java10
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/gui/SimpleFileChooser.java12
2 files changed, 15 insertions, 7 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleDialogs.java b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleDialogs.java
index b09fbd8..37f7edf 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleDialogs.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleDialogs.java
@@ -43,7 +43,9 @@ public class SimpleDialogs {
int value = Integer.parseInt(strang);
return (value < upperBound) && (value > lowerBound);
- } catch (NumberFormatException nfe) {
+ } catch (@SuppressWarnings("unused") NumberFormatException nfex) {
+ // We don't care about the specifics of the exception, just
+ // that this value isn't good
return false;
}
}, Integer::parseInt);
@@ -125,7 +127,9 @@ public class SimpleDialogs {
try {
Integer.parseInt(strang);
return true;
- } catch (NumberFormatException nfe) {
+ } catch (@SuppressWarnings("unused") NumberFormatException nfex) {
+ // We don't care about this exception, just mark the value
+ // as not good
return false;
}
}, Integer::parseInt);
@@ -257,7 +261,7 @@ public class SimpleDialogs {
throw new NullPointerException(
"Error message must not be null");
}
-
+
JOptionPane.showMessageDialog(parent, errorMessage, title,
JOptionPane.ERROR_MESSAGE);
}
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleFileChooser.java b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleFileChooser.java
index f39ff7c..b4c6d73 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleFileChooser.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleFileChooser.java
@@ -31,7 +31,8 @@ public class SimpleFileChooser {
maybeDoOpenFile(parent, files);
success = true;
- } catch (FileNotChosenException e) {
+ } catch (@SuppressWarnings("unused") FileNotChosenException fncx) {
+ // We don't care about specifics
SimpleDialogs.showError(parent, "I/O Error",
"Please pick a file to open");
}
@@ -55,7 +56,8 @@ public class SimpleFileChooser {
maybeDoSaveFile(parent, files);
return files.getSelectedFile();
- } catch (FileNotChosenException e) {
+ } catch (@SuppressWarnings("unused") FileNotChosenException fncex) {
+ // We don't care about specifics
SimpleDialogs.showError(parent, "I/O Error",
"Please pick a file to save to");
}
@@ -187,7 +189,8 @@ public class SimpleFileChooser {
try {
maybeDoOpenFile(parent, files);
- } catch (FileNotChosenException e) {
+ } catch (@SuppressWarnings("unused") FileNotChosenException fncex) {
+ // We don't care about specifics
}
return files.getSelectedFile();
@@ -212,7 +215,8 @@ public class SimpleFileChooser {
try {
maybeDoSaveFile(parent, files);
- } catch (FileNotChosenException e) {
+ } catch (@SuppressWarnings("unused") FileNotChosenException fncex) {
+ // We don't care about specifics
}
return files.getSelectedFile();