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

NullPointerException is thrown during Windows.updateChildFocusableWindowState(), Windows

XMLWordPrintable

    • b81
    • generic, x86
    • generic, windows, windows_xp

      The following exception is thrown as result of FileDialog.setVisible(true) call

      Exception in thread "main" java.lang.NullPointerException: null pData
             at sun.awt.windows.WWindowPeer.setFocusableWindow(Native Method)
             at sun.awt.windows.WWindowPeer.updateFocusableWindowState(WWindowPeer.java:66)
             at java.awt.Window.updateChildFocusableWindowState(Window.java:753)
             at java.awt.Dialog.conditionalShow(Dialog.java:928)
             at java.awt.Dialog.show(Dialog.java:1032)
             at java.awt.Component.show(Component.java:1415)
             at java.awt.Component.setVisible(Component.java:1368)
             at java.awt.Window.setVisible(Window.java:694)
             at java.awt.Dialog.setVisible(Dialog.java:983)
             at test.main(test.java:13)

      It's a regression of the fix for the bug (fixed in b79):
      6391763 REG: Window not gaining focus even after the parent dialog is made visible, WinXP

      This code (see Dialog.java) makes the bug visible:
      925 Window.updateChildFocusableWindowState(this);

      here's simple test to reproduce the problem.
      =================
      import java.awt.*;
      import java.awt.event.*;

      public class test {


          final static Frame frame = new Frame("frame");
          public static void main(String[] argv){

      FileDialog fd = new FileDialog(frame);
      fd.setMode(FileDialog.LOAD);
      fd.setTitle("File dialog");
      fd.setVisible(true);
          }

      }

            son Oleg Sukhodolsky (Inactive)
            dcherepanov Dmitry Cherepanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: