IE Hangs For Modal Dialogs from Applet
843807Oct 3 2002 — edited Oct 4 2002 I have one Problem After Installing Java 1.4.0 Plugin , the Modal Dialogs
Opened By the fn call from Html Button in the Applet gets Hanged . But the Same Work Fine with Clicking on the Button in the Applet . The Code is given below .
/*File: SearchDialog.java */
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*
<applet code=SearchDialog width=100 height=100>
</applet>
*/
public class SearchDialog extends Applet implements ActionListener
{
Dlg testdlg;
Button showdialog;
public void init()
{
showdialog = new Button("Show Dialog");
add(showdialog);
showdialog.addActionListener(this);
}
public void start()
{
}
public void stop()
{
}
public void showDialog()
{
testdlg = new Dlg();
testdlg.show();
}
public void actionPerformed(ActionEvent ae){
showDialog();
}
}
class Dlg extends Dialog
{
Button mButtonOk;
TextField mUserInputArea;
public Dlg()
{
super(new Frame(),"Search List",true);
setBounds(270,225,235,300);
setResizable(false);
setLayout(null);
mButtonOk = new Button("Ok");
mButtonOk.setBounds(47,207,61,22);
mUserInputArea = new TextField(25);
mUserInputArea.setBounds(30,60,150,25);
add(mUserInputArea);
add(mButtonOk);
EventHandler eventHandler = new EventHandler();
mButtonOk.addActionListener(eventHandler);
}
class EventHandler implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
if((Button)ae.getSource() == mButtonOk)
{
System.out.println(mUserInputArea.getText());
dispose();
}
}
}
}
------------------
/* File : TestDialog.html */
<html>
<body>
<applet code=SearchDialog width=200 height=200 name="DialogApp">
</applet>
<form>
<input type=button value="Display" onClick=document.DialogApp.showDialog() >
</form>
</body>
</html>
XXXXXXXXXXXXXXXXXXXX
This one Works well with Microsoft JVM . Can Any body try this code and able to find out the Problem . Or oterwise Anything Change of Implementation in JDK 1.4 . The same code works well for Modalless Dialogs.