Java examples for Swing:JOptionPane
show Error Dialog
//package com.java2s; import javax.swing.JOptionPane; public class Main { private static final String DEFAULT_ERROR_TITLE = "Error"; public static void showErrorDialog(Exception exception) { showErrorDialog(exception.getMessage()); }//from w ww . j a va 2s . c o m public static void showErrorDialog(String message) { JOptionPane.showMessageDialog(null, message, DEFAULT_ERROR_TITLE, JOptionPane.ERROR_MESSAGE); } }