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

NullPointerException in JFileChooser after navigating to empty folder

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      When using the JFileChooser's Save dialog with the WindowsLookAndFeel UI, any action following keyboard navigation to an empty folder will produce a NullPointerException.

      This bug occurs always in the following work flow:
      - create a New Folder
      - type a name for the folder and press enter
      - press enter again to navigate into the folder


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - compile the attached source
      - run Bug under java 1.6 on Windows XP
      - in the Save dialog, select an empty folder, then press enter
      - click to focus the File Name field

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The operation should complete without error.
      ACTUAL -
      A NullPointerException is thrown. Also, after navigating into the empty folder, the "Open" button text should have reverted to "Save", but it does not until after forcing the exception.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception occurred during event dispatching:
      java.lang.NullPointerException
              at javax.swing.JComponent.repaint(JComponent.java:4728)
              at sun.swing.FilePane$2.repaintListSelection(FilePane.java:114)
              at sun.swing.FilePane$2.repaintSelection(FilePane.java:104)
              at sun.swing.FilePane$2.focusLost(FilePane.java:99)
              at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:213)
              at java.awt.Component.processFocusEvent(Component.java:5930)
              at java.awt.Component.processEvent(Component.java:5794)
              at java.awt.Container.processEvent(Container.java:2058)
              at java.awt.Component.dispatchEventImpl(Component.java:4410)
              at java.awt.Container.dispatchEventImpl(Container.java:2116)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.ja
      va:1848)
              at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeybo
      ardFocusManager.java:878)
              at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFoc
      usManager.java:551)
              at java.awt.Component.dispatchEventImpl(Component.java:4282)
              at java.awt.Container.dispatchEventImpl(Container.java:2116)
              at java.awt.Component.dispatchEvent(Component.java:4240)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:183)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:177)
              at java.awt.Dialog$1.run(Dialog.java:1039)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:183)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:173)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFileChooser;
      import javax.swing.UIManager;

      public class Bug
      {
      public static void main(String[] args) throws Exception
      {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
      JFileChooser jfc = new JFileChooser();
      jfc.showSaveDialog(null);
      }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                loneid Leonid Popov (Inactive)
                Reporter:
                igor Igor Nekrestyanov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: