From 79144edde6a73ca11336a16a39cddba66c0e4460 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 10 May 2007 17:02:04 +0000 Subject: [PATCH] showing custom made error dialog instead of JOptionPane's --- .../sics/cooja/contikimote/ContikiMoteTypeDialog.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java index 594f47a4d..b078abc02 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMoteTypeDialog.java,v 1.26 2007/04/02 12:45:19 fros4943 Exp $ + * $Id: ContikiMoteTypeDialog.java,v 1.27 2007/05/10 17:02:04 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -1250,7 +1250,7 @@ public class ContikiMoteTypeDialog extends JDialog { String libString = CoreComm.getAvailableClassName(); if (libString == null) { logger.fatal("No more libraries can be loaded!"); - throw new Exception("Maximum number of mote types already exist"); + throw new MoteTypeCreationException("Maximum number of mote types already exist"); } // GENERATE NEW FILE @@ -2059,10 +2059,11 @@ public class ContikiMoteTypeDialog extends JDialog { try { myMoteType.doInit(textID.getText()); } catch (MoteTypeCreationException ex) { - JOptionPane.showMessageDialog(myDialog, - ex.getMessage(), + GUI.showErrorDialog( + myDialog, "Mote type creation error", - JOptionPane.ERROR_MESSAGE); + ex + ); return; } myMoteType.setDescription(textDescription.getText());