Dialogs Like a frame, a dialog box is a separate window. Unlike a frame, however, a dialog box is not completely independent. Every dialog box is associated with a frame, which is called its parent . The dialog box is dependent on its parent. For example, if the parent is closed, the dialog box will also be closed.
Dialog boxes can be either modal or modeless .
When a modal dialog is created, its parent frame is blocked. That is, the user will not be able to interact with the parent or even bring the parent to the front of the screen until the dialog box is closed. Modeless dialog boxes do not block their parents in the same way, so they seem a lot more like independent windows. In Java, a dialog box is an object belonging to the class Dialog or to one of its subclasses. A Dialog cannot have a menu bar, but it can contain other GUI components, and it generates the same WindowEvents as a Frame .