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

FocusManager.getCurrentManager() method throws NPE

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86, sparc
    • OS:
      generic, linux, solaris_2.6
    • Verification:
      Verified

      Description



      Name: nkR10003 Date: 10/20/2000


      Public static FocusManager.getCurrentManager() method throws
      NullPointerExcption (NPE).


      Example below demonstrates this problem:
      ------------------example--------------------
      //test.java
      import javax.swing.*;
      public class test {
          public static void main(String[] args) {
              System.out.println("current manager: "
                      + FocusManager.getCurrentManager());
              System.out.println("Passed: OKAY");
              System.exit(0);
          }
      }
      ----------------output:----------------------
      Exception in thread "main" java.lang.NullPointerException
      at javax.swing.DelegatingDefaultFocusManager.setDefaultFocusTraversalPolicy(FocusManager.java:172)
      at javax.swing.DefaultFocusManager.<init>(DefaultFocusManager.java:41)
      at javax.swing.DelegatingDefaultFocusManager.<init>(FocusManager.java:125)
      at javax.swing.FocusManager.getCurrentManager(FocusManager.java:63)
      at test.main(test.java:5)
      ---------------------------------------------
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svioletsunw Scott Violet (Inactive)
                Reporter:
                knasunw Kna Kna (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: