BUG: NullPointerException When Tabbing Inside a Dialog Box

ID: Q184601

The information in this article applies to:

SYMPTOMS

Attempting to TAB inside a dialog box, created by a Java application, causes the following exception:

   "Exception occurred during event dispatching
   java.lang.NullPointerException at ...."

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

1. Save this class to a file named Tabtest.java:

      import java.awt.*;
      public class Tabtest
      {
         public static void main (String argv[])
         {
            Frame frame = new Frame();
            frame.setSize(200, 200);
            frame.setVisible(true);
            frame.setLayout(new FlowLayout());
            Dialog d = new Dialog(frame, true);
            d.setSize(100,100);
            Component item;
            d.add(item = new Label("Tab inside this dialog"),"North");
            item.requestFocus();
            d.show();
         }
      }

2. Compile the file.

3. Run the class using this command:

      jview Tabtest

4. Press the TAB key when focus in inside the dialog box.

The nullPointerException exception that is generated.

NOTE: The same problem happens with AFC's UIDialog component.

Additional query words: dialog focus tab NullPointerException

Keywords          : AWTPkg 
Version           : WINDOWS:
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: April 29, 1998