show Exception - Java Swing

Java examples for Swing:JOptionPane

Description

show Exception

Demo Code


//package com.java2s;
import static javax.swing.JOptionPane.*;

public class Main {
    public static void showException(Exception e, String problem) {
        showErrorMessage(problem + "\n" + e.getMessage(), e.getClass()
                .getName());// w  w  w.ja  v a 2 s .c om
    }

    public static void showErrorMessage(String text, String title) {
        showMessageDialog(null, text, title, ERROR_MESSAGE);
    }

    public static void showErrorMessage(String text) {
        showErrorMessage(text, "Error");
    }
}

Related Tutorials