Java tutorial
//package com.java2s; import java.awt.Component; import javax.swing.JOptionPane; public class Main { /** * Displays an error-message. * * @param parent the parent <code>Component</code> * @param message the message to display */ public static void displayError(Component parent, String message) { JOptionPane.showMessageDialog(parent, message, null, JOptionPane.ERROR_MESSAGE); } }