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

FocusManager.getCurrentManager() method throws NPE

XMLWordPrintable

    • beta
    • x86, sparc
    • generic, linux, solaris_2.6
    • Verified



      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)
      ---------------------------------------------
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: