by Dinesh Thakur Category: Swing

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 :

import javax.swing.JOptionPane;

public class DialogBoxinJavaExample
{
          public static void main(String[] args)
        {
JOptionPane.showMessageDialog(null, " Dialog Box in Java Example ");
        }
}

 

           Dialog Box in Java Example



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles