Situation: I have Swing-based application with several windows which needs to be displayed at a time:
- Main application JFrame (might be minimized, but not closed)
- Floating JWindow (this needs to be always visible and always on top)
- Appearing in some circumstances JDialog (Dialog.ModalityType.APPLICATION_MODAL). I want this dialog be modal but not always on top
I had problem with floating window - in some cases it looses it's alwaysOnTop state. I solved it by introducing timer which will update this state with true every 5 seconds.
Problem: If I show JDialog then for some reason it's alwaysOnTop status will be in sync with floating JWindow. For example if I switch to other application, this JDialog will became always on top at the same time as I update alwaysOnTop for floating window.
Question: Why is that happening and how can I get rid of it?
Thanks in advance, Sergey