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

NPE when renaming files in JFileChooser (Windows UI)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta
    • x86
    • windows_nt



      Name: yyT116575 Date: 11/29/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      TO REPRODUCE:
      - Run the FileChooserDemo that comes with JDK 1.3.
      - Select the 'Windows' UI radio button.
      - click 'Show File Chooser' button, JFileChooser appears.
      - Click on a file or folder in the list of files to highlight that file.
      - Wait a second, then click again on the name to invoke the edit-in-place for
      renaming.
      - Wait a second, then click in the edit-in-place to actually give it focus.
      - Replace the name of the file with 'foo' in the entry field (do not hit enter!)
      - Hit tab. Focus moves to the 'File name' field, but edit-in-place remains
      present.
      - Click back in the edit-in-place to give it focus again.
      - Hit enter. Note nothing changes in the JFileChooser, but you get the
      following error on the output console:

      Exception occurred during event dispatching:
      java.lang.NullPointerException
              at
      com.sun.java.swing.plaf.windows.WindowsFileChooserUI$EditActionListener.actionPe
      rformed(WindowsFileChooserUI.java:509)
              at javax.swing.JTextField.fireActionPerformed(JTextField.java:421)
              at javax.swing.JTextField.postActionEvent(JTextField.java:586)
              at
      javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:696)
              at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1702)
              at javax.swing.JComponent.processKeyBinding(JComponent.java:2156)
              at javax.swing.JComponent.processKeyBindings(JComponent.java:2182)
              at javax.swing.JComponent.processKeyEvent(JComponent.java:2119)
              at java.awt.Component.processEvent(Component.java:3555)
              at java.awt.Container.processEvent(Container.java:1164)
              at java.awt.Component.dispatchEventImpl(Component.java:2595)
              at java.awt.Container.dispatchEventImpl(Container.java:1213)
              at java.awt.Component.dispatchEvent(Component.java:2499)
              at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
              at java.awt.Container.dispatchEventImpl(Container.java:1200)
              at java.awt.Window.dispatchEventImpl(Window.java:912)
              at java.awt.Component.dispatchEvent(Component.java:2499)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
              at
      java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
              at java.awt.Dialog.show(Dialog.java:370)
              at javax.swing.JFileChooser.showDialog(JFileChooser.java:620)
              at FileChooserDemo.actionPerformed(FileChooserDemo.java:362)
              at
      javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
              at
      javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.ja
      va:1504)
              at
      javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
              at
      javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
              at
      javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
      a:216)
              at java.awt.Component.processMouseEvent(Component.java:3717)
              at java.awt.Component.processEvent(Component.java:3546)
              at java.awt.Container.processEvent(Container.java:1164)
              at java.awt.Component.dispatchEventImpl(Component.java:2595)
              at java.awt.Container.dispatchEventImpl(Container.java:1213)
              at java.awt.Component.dispatchEvent(Component.java:2499)
              at
      java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
              at java.awt.Container.dispatchEventImpl(Container.java:1200)
              at java.awt.Window.dispatchEventImpl(Window.java:912)
              at java.awt.Component.dispatchEvent(Component.java:2499)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
              at
      java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

      Note that this problem may not need to be solved if the Windows UI is changed to
      more accurately reflect native Windows behavior.

      Originally, we had planned to rely on the 'New Folder' feature of JFileChooser
      to allow users to create directories, but this bug makes that approach
      unpalatable.
      (Review ID: 112701)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            yyoungsunw Yung-ching Young (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: