A dialog box can be either modal or non-modal. A dialog box is modal if the user must first dismiss it
before clicking elsewhere. Unfortunately, the code that invokes a Dialog box does not automatically wait for the user to finish, the way
it does in most non-Java GUI (Graphic User Interface) interfaces.