Java modal window


Hi everyone, today i want to share with you about MODAL WINDOW.How it's look like? Before i show you example of MODAL WINDOW, let we look for it's little description :

If a window is modal, no other window can be active while the modal window is displayed.

Simple example is message box from JOptionPane. When a message box is showing, you can't work with other window until you press OK or others button on the message box.
This message box is a simple example of MODAL WINDOW.

You can try compile java code below to see how it's look like.

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


import javax.swing.JFrame;

import javax.swing.JOptionPane;

public class ModalWindow
{
public static void main(String[]args)
{
JFrame myWindow=new JFrame("My Window");

myWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myWindow.setSize(400,400);
myWindow.setVisible(true);

JOptionPane.showMessageDialog(null,"Hello");
}
}


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