Here you can find the source of excMsg(String msg, Exception ex)
Parameter | Description |
---|---|
msg | a parameter |
ex | a parameter |
public static void excMsg(String msg, Exception ex)
//package com.java2s; //License from project: Open Source License import javax.swing.JOptionPane; import javax.swing.SwingUtilities; public class Main { public static final String LS = System.getProperty("line.separator"); /**//from www . ja v a 2 s . com * Exception message dialog. Displays message plus the exception and * exception message. * * @param msg * @param ex */ public static void excMsg(String msg, Exception ex) { final String fullMsg = msg += LS + "Exception: " + ex + LS + ex.getMessage(); // Show it in a message box SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, fullMsg, "Error", JOptionPane.ERROR_MESSAGE); System.out.println(fullMsg); } }); } /** * Exception message dialog. Displays message plus the error and error * message. * * @param msg * @param ex */ public static void excMsg(String msg, Error ex) { final String fullMsg = msg += LS + "Error: " + ex + LS + ex.getMessage(); // Show it in a message box SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, fullMsg, "Error", JOptionPane.ERROR_MESSAGE); } }); } /** * Exception message dialog. Displays message plus the throwable and * throwable message. * * @param msg * @param t */ public static void excMsg(String msg, Throwable t) { final String fullMsg = msg += LS + "Throwable: " + t + LS + t.getMessage(); // Show it in a message box SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, fullMsg, "Error", JOptionPane.ERROR_MESSAGE); } }); } }