diff --git a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java index a9db644047546a7a63cd8939583e5f9e3f9c708e..6f61836826d53f690607ac05cea3b20a5f591a10 100644 --- a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java +++ b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java @@ -62,6 +62,9 @@ import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JTextField; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + import org.apache.log4j.Logger; import org.cnrs.lam.cesam.vo.dnd.VoTable1DHelper; import org.cnrs.lam.dis.etc.configuration.ConfigFactory; @@ -80,7 +83,6 @@ import org.cnrs.lam.dis.etc.ui.SampListener; import org.cnrs.lam.dis.etc.ui.SessionListener; import org.cnrs.lam.dis.etc.ui.SiteListener; import org.cnrs.lam.dis.etc.ui.SourceListener; -import org.cnrs.lam.dis.etc.ui.UIManager; import org.cnrs.lam.dis.etc.ui.generic.BuisnessListenerHolder; import org.cnrs.lam.dis.etc.ui.generic.DatasetListenerHolder; import org.cnrs.lam.dis.etc.ui.generic.InfoProviderHolder; @@ -109,7 +111,7 @@ import org.json.JSONObject; * * @author Nikolaos Apostolakos */ -public class EtcFrame extends javax.swing.JFrame implements UIManager { +public class EtcFrame extends javax.swing.JFrame implements org.cnrs.lam.dis.etc.ui.UIManager { /** * diff --git a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java index 3d6ef8da8cd9944e5a30f7fed016f1582762de06..6b2eed5232f26d3553b36bd8a65e1cccf8f45005 100644 --- a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java +++ b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java @@ -147,17 +147,15 @@ public class AboutDialog extends HelpDialog { Font fontContact = contactLabel.getFont(); Font boldFontContact = new Font(fontContact.getFontName(), Font.BOLD, fontContact.getSize()); contactLabel.setFont(boldFontContact); - String contactURL = ""+ CONTACT_URL +""; + String contactURL = ""+ CONTACT_URL +""; JLabel contactUrlLabel = new JLabel(contactURL); contactUrlLabel.setAlignmentX(LEFT_ALIGNMENT); contactUrlLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); contactUrlLabel.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) + public void mouseClicked(MouseEvent evt) { - try { - UtilsLoader.openMail(new URL(CONTACT_URL)); - } catch (MalformedURLException e1) {} + UtilsLoader.openMail(CONTACT_URL); } }); diff --git a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java index 0bcac034957225df535ff34e11c0265a9fabae64..090575db1048c59e4e9beab8f58ff005e0889a27 100644 --- a/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java +++ b/ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java @@ -16,10 +16,16 @@ public class UtilsLoader { } } - public static void openMail(URL url) { - try { - Desktop.getDesktop().mail(new URI("mailto:" + url + "?subject=ETC-42")); - } catch (IOException | URISyntaxException e) {} + public static void openMail(String urlString) { + System.out.println(urlString); + Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; + if (desktop != null && desktop.isSupported(Desktop.Action.MAIL)) { + try { + Desktop.getDesktop().mail(new URI("mailto:" + urlString + "?subject=ETC-42")); + } catch (IOException | URISyntaxException e) { + System.out.println(e.getMessage()); + } + } } public static void openWebpage(URL url) { diff --git a/keystore b/keystore new file mode 100644 index 0000000000000000000000000000000000000000..974e9700cc247adbed3b0cc6c9b36e9e583eeb07 Binary files /dev/null and b/keystore differ