The applet consists of following code:
public class TestApplet extends Applet {
public TestApplet() {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
JDialog dialog = new JDialog();
dialog.setContentPane(new JLabel("Hello"));
dialog.setSize(new Dimension(300, 200));
dialog.setModal(true);
dialog.setVisible(true);
}
});
}}
When I open it on InternetExplorer running on Windows 7 it works: I change browser tabs, dialog always stays in front.
When I open it on Firefox ESR 10.0.5 running on Red Hat Enterprise Linux Server Release 6.3, Java 1.7.0_07-b10 then it instantly goes behind the Browser window and I have to minimize browser in order to find it again.
What do I have to do to make the modal dialog always stay in front of the Applet?
Update:
Changing creation of JDialog to
JDialog dialog = new JDialog(javax.swing.SwingUtilities.getWindowAncestor(TestApplet.this));
makes not difference.
Finally, after trying alot of things I figured out the following workaround: