KeyboardFocusManager class exposes some properties like 'activeWindow' or 'focusOwner' that are available through add/removePropertyChangeListener() API. Howeverm 'activeWindow' property change event is not fired for windows native (file/print/page) dialogs.
To reproduce the problem, run the test attached to this bug report. The test shows a frame and a file dialog. The corresponding changes of 'activeWindow' property are printlned to the console.
This bug, along with many others related to windows native dialogs, will be probably fixed with 6179142.