Dialog class extends
Form, and it is used to present information to the user, as well as to collect the user's response to it. While a dialog is very similar to a form, there are some differences as well. One very significant difference in the way these two widgets work is that Dialog is modal by default. Modality means that the thread calling a dialog will block until the
dispose() method of the dialog is called. Another implication of modality is that the user's response can be assumed to be available in the line of code, right after the
show() method is called.
A dialog is also different from the form in size. The dialog occupies only a part of the screen. The following screenshot shows a dialog with an Exit command. In this ...