How are you creating the modal dialog? If you use the JDialog constructor that takes a Frame argument, the dialog will stay on top of the parent Frame. I'm not sure how this works with default dialogs created with JOptionDialog, but it sould be similar.
Actually, this is probably the wrong forum to ask such a question. We have a
GUI forum where people will probably be more knowledgeable about such details.
Layne