+
+ /**
+ * Display an error message and log the linked {@link Exception}.
+ *
+ * @param owner the owner of the error (to link the messagebox to it)
+ * @param message the message
+ * @param title the title of the error message
+ * @param e the exception to log if any
+ */
+ static public void error(final Component owner, final String message, final String title, Exception e) {
+ Instance.getInstance().getTraceHandler().error(title + ": " + message);
+ if (e != null) {
+ Instance.getInstance().getTraceHandler().error(e);
+ }
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ JOptionPane.showMessageDialog(owner, message, title, JOptionPane.ERROR_MESSAGE);
+ }
+ });
+ }