Java class named JOptionPane that produce dialog boxes. A dialog box is a GUI object in which you can place messages that you want to display on the screen. The showMessageDialog() method that is part of the JOptionPane class. The showMessageDialog() method is followed by a set of parentheses. The showMessageDialog() are two arguments. The first argument is null. its means the message box should be shown in the center of the screen. After the comma, second argument is the string that should be output.
Here is the java code for the program Dialog Box in Java Example :
public class DialogBoxinJavaExample
public static void main(String args)
JOptionPane.showMessageDialog(null, " Dialog Box in Java Example ");