Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

IE7 hangs sporadically when running applets (with modal windows?)

Thread view: 
usenet@kikobu.com - 24 Oct 2006 09:54 GMT
Hi.

I have an applet which uses a FileDialog to retrieve reference to a
file in the file system. This applet has worked without problems in
earlier IE versions and other browsers, but occasionally under IE7 when
closing the FileDialog, and effectively freezes the browser.

The last few lines in the applet console:

---
Modality pushed
20-10-2006 07:39:36 sun.plugin.util.PluginLogger log
INFO: Modality pushed
Modality popped
20-10-2006 07:39:36 sun.plugin.util.PluginLogger log
INFO: Modality popped
---

I've read about another user in comp.lang.java.programmer who has the
same problem, and also with modal windows it appears. Has anyone had
similar experiences?

Thanks.

Morten
usenet@kikobu.com - 24 Oct 2006 13:35 GMT
This is reproducible with the following simple applet. You do not even
need to select a file, simply hitting "Esc" when the file dialog is
open is sufficient to hang IE7. I strongly suspect there's a problem in
IE with handing focus back to the main window after having had a modal
window.

package test;

import java.applet.Applet;
import java.awt.Button;
import java.awt.Color;
import java.awt.Event;
import java.awt.FileDialog;
import java.awt.Frame;
import java.awt.Panel;
import java.io.File;

public class ModalFileDialogTest extends Applet {

    private static final long serialVersionUID = 1351796453988581417L;

    public ModalFileDialogTest() {
        Panel p = new Panel();
        p.add(new Button("Open"));
        p.setBackground(new Color(255, 255, 255));

        add("North",p);
    }

    public boolean action(Event evt, Object arg) {
        if ("Open".equals(arg)) {
            System.out.println("Opening file selection");

            FileDialog fd = new FileDialog(new Frame());
            fd.setMode(FileDialog.LOAD);
            fd.show();

            String selectedItem = fd.getFile();

            if (selectedItem == null) {
                System.out.println("No file selected");
            }
            else {
                File file = new File(fd.getDirectory() + File.separator +
fd.getFile());
                System.out.println("Selected file: " + file.getName());
            }

            return true;
        }
        else {
            System.out.println("Unexpected arg: "+arg);
            return false;
        }
    }
}

The HTML:

<html>
<body bgcolor="#dddddd">
    <applet code="test.ModalFileDialogTest.class" archive="modaltest.jar"
width="100" height="100">
    </applet>
</body>
</html>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.