Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5024342

calling getActiveWindow in an applet in IE returns null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 7-pool
    • 5.0
    • deploy
    • generic
    • windows_xp

      KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() returns null in IE browser. In Mozilla, it returns WNetscapeEmbeddeFrame and in appletviewer, it returns AppletViewer.


      import java.awt.Window;
      import java.awt.KeyboardFocusManager;
      import java.io.File;
      import java.io.FileWriter;
      public class OwnerApplet extends javax.swing.JApplet
      {
          public void start()
          {

      Window owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().
      getActiveWindow();

      FileWriter fo;
      try {
      fo = new FileWriter(new File("c:/owner.out"));
      fo.write("OwnerApplet.java, OWNER = "+owner);
      fo.flush();
      fo.close();
      } catch (Exception e) {
      }
          }
      }

      When this happens it makes it impossible to create dialogs that are
      modal wrt the parent.
      Since this works in appletviewer and mozilla I am assuming its a problem
      in the IE plugin

            almatvee Alexander Matveev
            jgodinez Jennifer Godinez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: