Display a warning message dialog with JOptionPane in Java
Description
The following code shows how to display a warning message dialog with JOptionPane.
Example
//www .ja va 2s . co m
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "A deprecated call", "Warning",
JOptionPane.WARNING_MESSAGE);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »