Skip to content
Snippets Groups Projects
Commit a7198d9b authored by Falilou Thiam's avatar Falilou Thiam
Browse files

no popup if headless

parent ffe227da
Branches
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ package fr.soleil.bensikin; ...@@ -50,6 +50,7 @@ package fr.soleil.bensikin;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Frame; import java.awt.Frame;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.io.File; import java.io.File;
import java.util.Locale; import java.util.Locale;
...@@ -175,7 +176,9 @@ public class Bensikin { ...@@ -175,7 +176,9 @@ public class Bensikin {
public static void treatError(Exception e, String message, Splash splash) { public static void treatError(Exception e, String message, Splash splash) {
String msg = "Bensikin encountered an undesired error and will close:\n" + e.getMessage(); String msg = "Bensikin encountered an undesired error and will close:\n" + e.getMessage();
if (!GraphicsEnvironment.isHeadless()) {
JOptionPane.showMessageDialog(splash, msg, "Bensikin Error!", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(splash, msg, "Bensikin Error!", JOptionPane.ERROR_MESSAGE);
}
if (message == null) { if (message == null) {
message = msg; message = msg;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment