Closed
Bug 206749
Opened 22 years ago
Closed 21 years ago
Netscape 7 and Mozilla crash after popping up Java modal dialog box
Categories
(Core Graveyard :: Java: OJI, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: vmehta1, Assigned: blackconnect)
References
()
Details
(Keywords: crash, stackwanted)
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461; AT&T CSM6.0; Hotbar 4.1.8.0)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
Netscape 7 crashes when Java Modal Dialog box is popped up. It workes fine if
the dialog box is not made modal. You can view the example at
http://web.njit.edu/~vsm3/ModalDialogBug/jtkTest.html and click on the Browse
button that will pop up the dialog box but when you hit OK or Cancel button the
dialog box will not disappear but the browser hangs and crashes. If the dialog
box is not made modal then ActionEvent on OK or Cancel button works fine in
Netscape Browser. This example works fine in other browsers without any
problem.
You can get the source code at :
http://web.njit.edu/~vsm3/ModalDialogBug/
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Here is the html and java source code for the example show at the URL :
HTML FILE jtkTest.html
<html>
<head>
<script language="JavaScript">
function doDiag() {
var value1=document.JavaSablime.getDirectory("");
alert (value1);
if (value1 != "false") {
self.document.forms[0].bFile.value=value1;
}
}
</script>
<title>Test for java Toolkit - Microsoft,SUN,HP</title>
</head>
<body>
<form>
<table border=0 align=center cellspacing=2 cellpadding=3 cols=2>
<tr align=center>
<td width=50% align=left>
<input type=text name=bFile>
</td>
<td width=50%>
<input type=button name=copyFile value="Browse" onClick=doDiag()>
</td>
</tr>
</table>
</form>
<APPLET CODE=JavaSablime NAME=JavaSablime HEIGHT=30 WIDTH=500>
<!--<PARAM NAME=browser VALUE=Explorer >-->
<PARAM NAME=browser VALUE=Netscape >
</APPLET>
</body>
</html>
Java File "JavaSablime.java"
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.util.*;
import java.io.*;
public class JavaSablime extends Applet
{
public String verifyExists;
private String browser;
private final String IE = "Explorer";
private final String netscape = "Netscape";
private int tint;
private Frame f;
private FDialog fd;
private boolean modal=true;
public void init()
{
verifyExists="true";
setBackground(new Color(255,255,240));
browser=getParameter("browser");
System.out.println("Your Java Version is : "+System.getProperty
("java.version"));
StringTokenizer secStk=new StringTokenizer(System.getProperty
("java.version"),".");
tint= (new Integer(secStk.nextToken()+secStk.nextToken
())).intValue();
//If we uncomment this code that there is no problem with Dilog box in
Netscape 7 browser. i.e. removing
//modalness of the dialog box works fine with Netscape 7.
//if (browser.equals(netscape) && tint>11)
// modal=false;
if (tint <= 11 && browser.equals(netscape))
f=(Frame)(this.getParent());
else if (tint <= 11 && browser.equals(IE)) {
f=new Frame();
f.setVisible(false);
}
else {
f=(Frame)(this.getParent().getParent());
}
fd=new FDialog(f,browser,modal);
}
public String getVerifyExists()
{
return verifyExists;
}
public String getDirectory(String path) {
return fd.showDirectory(path);
}
}
class FDialog extends Dialog implements
ActionListener,ItemListener,WindowListener{
private java.awt.List tList;
private TextField tField;
private Button parent;
private Choice driveChooser;
private Panel top;
private Panel bottom;
private Panel bottomp1;
private Button bOk;
private Button bCancel;
private boolean bDeselect=false;
private boolean sync=false;
private String syncStr="false";
private String browser="IE";
private final String IE = "Explorer";
private final String netscape = "Netscape";
private Frame myframe;
boolean bthread=true;
FDialog(Frame f,String browser,boolean modal) {
super(f,"Select Directory",modal);
this.myframe=f;
this.browser=browser;
setSize(400,250);
setLocation(125,150);
setResizable(false);
tList=new java.awt.List(10,false);
tField=new TextField("",50);
tField.setEditable(false);
tField.setBackground(Color.lightGray);
parent=new Button("..");
top=new Panel();
top.setLayout(new BorderLayout());
top.add("West",tField);
add("North",top);
add("Center",tList);
bottom=new Panel();
driveChooser=new Choice();
driveChooser.addItemListener(this);
runDriveChooser();
bottom.setLayout(new BorderLayout(5,5));
bottom.add("North",driveChooser);
bottomp1=new Panel();
bottomp1.setLayout(new FlowLayout());
bOk=new Button("OK");
bCancel=new Button("Cancel");
bOk.addActionListener(this);
bCancel.addActionListener(this);
bottomp1.add(bOk);
bottomp1.add(bCancel);
bottom.add("South",bottomp1);
add("South",bottom);
addWindowListener(this);
}
private void runDriveChooser() {
driveChooser.add("A:\\");
driveChooser.add("C:\\");
driveChooser.select("C:\\");
displayDirectory("C:\\");
}
public void itemStateChanged(ItemEvent e) {
if(e.getSource() instanceof Choice) {
displayDirectory(driveChooser.getSelectedItem());
}
}
public void actionPerformed(ActionEvent e) {
if(e.getSource() instanceof Button) {
Button b=(Button)e.getSource();
String arg=b.getLabel();
if(arg.equals("OK")) {
returnDirectory();
syncDirectory();
}
else if(arg.equals("Cancel")) {
syncDirectory();
}
}
}
private void displayDirectory(String path) {
String[] arr={"com","DRIVERS","INSTALL","My Music","Program
Files","WinNT","WIN32APP"};
tList.removeAll();
if (!path.equals("C:\\")) {
arr[0]="contents";
arr[1]="files";
arr[2]="music";
arr[3]="Photos";
arr[4]="data";
arr[5]="instruction";
arr[6]="other";
}
if(!path.endsWith(File.separator))
tField.setText(path+File.separator);
else
tField.setText(path);
if(arr != null && arr.length>0) {
arr=sort(arr);
for (int i=0; i<arr.length;i++)
tList.add(arr[i]);
}
}
private String[] sort(String[] mySort) {
return mySort;
}
private void returnDirectory() {
syncStr=tField.getText()+tList.getSelectedItem();
if(syncStr.endsWith(File.separator))
syncStr=syncStr.substring(0,syncStr.length()-1);
}
private void syncDirectory() {
sync=true;
setVisible(false);
}
private void makeVisible(String path) {
syncStr="false";
sync=false;
try {
if (path.equals("")) {
path="NULL";
}
}
catch (NullPointerException npe) {
path="NULL";
}
if(!path.equals("NULL")) {
char c=(File.separator).charAt(0);
path=path.replace('/',c);
path=path.replace('\\',c);
String path1=path;
if(!path1.endsWith(File.separator))
path1+=File.separator;
tField.setText(path1);
displayDirectory(path);
int i=path1.indexOf(File.separator);
String chp;
if(i!=-1) {
chp=path1.substring(0,i+1);
}
else
chp=path1;
driveChooser.select(chp);
}
}
public String showDirectory(String path) {
makeVisible(path);
setVisible(true);
//System.out.println("Came in another syncStr:"+syncStr);
return syncStr;
}
public void windowActivated(WindowEvent e)
{
}
public void windowDeactivated(WindowEvent e)
{
}
public void windowIconified(WindowEvent e)
{
}
public void windowDeiconified(WindowEvent e)
{
}
public void windowOpened(WindowEvent e)
{
tList.requestFocus();
}
public void windowClosing(WindowEvent e)
{
syncDirectory();
}
public void windowClosed(WindowEvent e)
{
}
}
Comment 1•22 years ago
|
||
(a) This is not a forum for bugs with the Netscape 7 product. See netscape.com
for that.
(b) I cannot reproduce this crash with Mozilla Nightly 2003051608/OS X, but I
also don't see a modal dialog box at all.
| Reporter | ||
Comment 2•22 years ago
|
||
I am able to reproduce this on Mozilla Nightly Build also, OS is Windows 2000.
The Version of the Mozilla that I tested was Mozilla/5.0 (Windows; U; Windows
NT 5.0; en-US; rv:1.4b) Gecko/20030522
and the Java Plugin that I used is
Java(TM) Plug-in: Version 1.4.0_01
Using JRE version 1.4.0_01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\vmehta1.NA01
I am not sure why Dialog box didn't popup on your browser. This may be because
the Java Plugin might not be configured properly I suppose.
Vikas Mehta
Vikas, does TalkBack run after this crash? If so, please provide a
representative incident ID.
Component: Java-Implemented Plugins → OJI
Keywords: crash,
stackwanted
Summary: Netscape 7 crashes after popping up Java Modal Dialog Box. → Netscape 7 and Mozilla crash after popping up Java modal dialog box
| Reporter | ||
Comment 4•22 years ago
|
||
I am not sure what TalkBack is, Can you provide me pointer how to activate or
what shall I do to check whether it is working or not.
Comment 5•22 years ago
|
||
I confirm this bug too, my version is Mozilla/5.0 (Windows; U; Windows NT 5.1;
fr-FR; rv:1.4b) Gecko/20030521
But talkback is unusable because the browser don't crash, it just freezes !
Comment 6•22 years ago
|
||
wfm using build 2003070405 (trunk) on Linux + Sun's JRE 1.4.2.
Can you try again with JRE 1.4.2 ?
Comment 7•21 years ago
|
||
Works for me with Firefox 0.8, Java 1.4.2_01 and XP. Modal dialog appears and
goes away again when I click OK, setting the text box's value correctly.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•