Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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.




Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 1 2002
Added on Oct 3 2002
1 comment
102 views