How does java.awt.dialog achieve modality?

awt, java, modal-dialog, user-interface

Solution

Its system dependent. On windows the main event loop is modified. You are most of the time better off opening a dialog non-modal and lock the underlying window manually (e.g. set a glasspane to the rootpane and disable it, or block all events setting a custom focus manager).

Problem

I want to understand how `java.awt.Dialog` achieves modality (blocking other windows)? Yeah, I tried reading the code of `java.awt.Dialog`, but I am kind of getting lost in it. So I want to know briefly what they do. Do they disable all events of all other windows? Thanks Prem

Original source