- Version
- Download 185
- File Size 1.28 KB
- File Count 1
- Create Date April 17, 2016
- Last Updated April 17, 2016
JOptionPane in Java
JOptionPane in Java
A sample program in java that shows the different dialogs of JOptionPane; showMessageDialog which displays a message, showConfirmDialog which shows three options (yes, no and cancel), showInputDialog which allows you to input or enter a text.
Source code:
import javax.swing.JOptionPane;
public class swingdialog
{
public static void main (String args[])
{
JOptionPane.showMessageDialog(null,"Hello World");
JOptionPane.showConfirmDialog(null,"Confirmation Dialog");
JOptionPane.showInputDialog(null,"Input Dialog");
}
}