Show error message dialog with JOptionPane in Java
Description
The following code shows how to show error message dialog with JOptionPane.
Example
import javax.swing.JOptionPane;
/* ww w .j av a 2s .com*/
public class Main {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "There's a bug on you!",
"Hey!", JOptionPane.ERROR_MESSAGE);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »