Say I have a class MyDialogClass extends JDialog
, which I use everywhere in my application, in order to acheive some specific behaviour of my dialogs. Now, I also want to enjoy the benefits of JOptionPane
utilities, and call showXxxDialog
to view messages / errors etc., but I still want the underlying dialogs to behave as a MyDialogClass
instances.
Is it possible to achive (prefferably without deeply replicating the source of JOptionPane
)?
EDIT:
The specific behaviour I am trying to acheive is setting the dialog alwaysOnTop
to true
. I will try @Andrew's solution for this issue. BUT, this is only the current problem I'm facing, and not the only extended behaviour in MyDialogClass
. So there might be such "workaround" for every single problem, but I was intentionaly looking for a conceptual solution, which is the reason for putting my question as I originally did.
[[For instance - MyDialogClass
also registeres a WindowListener
to it's instances in the constructor]]