13.10. The Dialog Class

A Dialog is a stripped-down Frame, useful for applications that don't need all of the capabilities of a Frame. A Dialog has two major roles:

  1. A modal dialog that freezes interaction with other AWT components until it is closed. A modal dialog is used in situations that require the user to respond before other processing can continue.

  2. A simplified frame (no cursor, menu, icon image). A nonmodal dialog is used in a similar manner to its use in a Frame but requires fewer resources and is faster to pop up.

A Dialog also has a BorderLayout manager that divides the screen into five regions: NORTH, SOUTH, EAST, WEST, and CENTER. See the discussion of BorderLayout in Chapter 12 (Layout Managers).

Creating and Using a Dialog

Using ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.