If you make a JDialog modal and launch it from a JApplet on win32 you still can access the gui components within the applet. The same code enforces modality properly when run on Solaris.
Test environment:
Windows NT 4.0
Netscape 4.03
Java Plugin 1.1
Swing 1.0.3
Solaris 2.6
Netscape 4.05
Java Plugin 1.1
Swing1.0.3
The following test case demonstrates this. Compile the test case and open the html page within netscape on win32. Click on the button to launch a modal dialog. Then try to click the button again. Nothing should happen, but instead another dialog is launched.
TestApplet.java
import com.sun.java.swing.*;
import java.awt.event.*;
public class TestApplet extends JApplet implements ActionListener
{
public void init()
{
JButton button = new JButton("Press me to pop up a modal dialog");
getContentPane().add(button);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
JOptionPane.showConfirmDialog(getContentPane(),"information","information",JOptionPane.YES_NO_OPTION);
}
}
TestApplet.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>TestApplet</title>
</head>
<body>
<h1>TestApplet</h1>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.0 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 200 HEIGHT = 100 codebase="http://java.sun.com/products/plugin/1.1.1/jinstall-111-win32.cab#Version=1,1,1,0">
<PARAM NAME = CODE VALUE = "TestApplet.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.1" java_CODE = "TestApplet.class" WIDTH = 200 HEIGHT = 100 pluginspage="http://java.sun.com/products/plugin/1.1.1/plugin-install.html"><NOEMBED></COMMENT>
</NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET CODE = "TestApplet.class" WIDTH = 200 HEIGHT = 100 >
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</body>
</html>
Test environment:
Windows NT 4.0
Netscape 4.03
Java Plugin 1.1
Swing 1.0.3
Solaris 2.6
Netscape 4.05
Java Plugin 1.1
Swing1.0.3
The following test case demonstrates this. Compile the test case and open the html page within netscape on win32. Click on the button to launch a modal dialog. Then try to click the button again. Nothing should happen, but instead another dialog is launched.
TestApplet.java
import com.sun.java.swing.*;
import java.awt.event.*;
public class TestApplet extends JApplet implements ActionListener
{
public void init()
{
JButton button = new JButton("Press me to pop up a modal dialog");
getContentPane().add(button);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
JOptionPane.showConfirmDialog(getContentPane(),"information","information",JOptionPane.YES_NO_OPTION);
}
}
TestApplet.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>TestApplet</title>
</head>
<body>
<h1>TestApplet</h1>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.0 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 200 HEIGHT = 100 codebase="http://java.sun.com/products/plugin/1.1.1/jinstall-111-win32.cab#Version=1,1,1,0">
<PARAM NAME = CODE VALUE = "TestApplet.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.1" java_CODE = "TestApplet.class" WIDTH = 200 HEIGHT = 100 pluginspage="http://java.sun.com/products/plugin/1.1.1/plugin-install.html"><NOEMBED></COMMENT>
</NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET CODE = "TestApplet.class" WIDTH = 200 HEIGHT = 100 >
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</body>
</html>
- duplicates
-
JDK-4187432 EnableModeless(false) does not prevent modeless dialogs
-
- Resolved
-