Forum Stats

  • 3,853,732 Users
  • 2,264,259 Discussions
  • 7,905,436 Comments

Discussions

IE Hangs For Modal Dialogs from Applet

843807
843807 Member Posts: 46,582
edited Oct 4, 2002 10:57PM in Java Applet Development
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.




Comments

  • 843807
    843807 Member Posts: 46,582
    LiveConnect which enable you to call a Java method from JavaScript was not fully implemented in 1.4.0 (as a matter of fact, I don't think it's fully implemented in 1.4.1 either). Your applet should still function correctly if you disable the plugin (take a look at Tools | Internet Options | Advanced | Microsoft VM and make sure that you've selected the native JVM -- you may have to reboot for the change to take effect). If I remember correctly, when you install 1.4, there is a box where you can check whether or not to automatically activate the plugin.

    Good luck!

    ;o)

    V.V.
This discussion has been closed.