Create message box in java

Complete source code below will show you, how to create message box in java. We will use JOptionPane class to create message box. If you want your message box appear in a container, you can change null in source code below to target container.You can see example by click here.

************************************************************************
COMPLETE SOURCE CODE FOR : JavaMessageDialog.java
************************************************************************


import javax.swing.JOptionPane;

public class JavaMessageDialog
{
public static void main(String[]args)
{
//Pop up a message box with text ( I am a message dialog )
JOptionPane.showMessageDialog(null,"I am a message dialog");
}
}


************************************************************************
JUST COMPILE AND EXECUTE IT
************************************************************************

RELAXING NATURE VIDEO