-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.4.0
-
x86
-
windows_2000
Name: bsC130419 Date: 06/14/2001
c:\>java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
In JDK 1.2 and JDK 1.3, you could do the following
new JFileChooser(".")
which brought up a JFileChooser in the currentl directory. In JDK 1.4, the
JFileChooser fails in an erratic manner when "." is used in the constructor.
If "." is used, the JFileChooser opens up, with the current directory displayed
in the Combo Box at the top, but no files are displayed. Re-selecting the exact
same directory in the combo box causes the files in the directory to then be
displayed!
If you try to move up one directory *before* you reselect the current directory
(as described above) the following exception is thrown.
FileSystemView.getShellFolder: f=.
java.lang.InternalError: Could not parse file path
at sun.awt.shell.Win32ShellFolder.initFile(Native Method)
at sun.awt.shell.Win32ShellFolder.<init>(Win32ShellFolder.java:175)
at sun.awt.shell.Win32ShellFolder.<init>(Win32ShellFolder.java:182)
at
sun.awt.shell.Win32ShellFolderManager.createShellFolder(Win32ShellFolderManager.java:34)
at sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:194)
at javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:447)
at javax.swing.filechooser.FileSystemView.getParentDirectory(FileSystemView.java:423)
at javax.swing.JFileChooser.changeToParentDirectory(JFileChooser.java:545)
at
javax.swing.plaf.basic.BasicFileChooserUI$ChangeToParentDirectoryAction.actionPerformed(BasicFileChooserUI.java:658)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1722)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1775)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:414)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:253)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:261)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:230)
at java.awt.Component.processMouseEvent(Component.java:4906)
at java.awt.Component.processEvent(Component.java:4732)
at java.awt.Container.processEvent(Container.java:1337)
at java.awt.Component.dispatchEventImpl(Component.java:3476)
at java.awt.Container.dispatchEventImpl(Container.java:1399)
at java.awt.Component.dispatchEvent(Component.java:3343)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3302)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3014)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2967)
at java.awt.Container.dispatchEventImpl(Container.java:1373)
at java.awt.Window.dispatchEventImpl(Window.java:1459)
at java.awt.Component.dispatchEvent(Component.java:3343)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:439)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:131)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
java.lang.NullPointerException
at javax.swing.filechooser.FileSystemView.getParentDirectory(FileSystemView.java:424)
at javax.swing.JFileChooser.changeToParentDirectory(JFileChooser.java:545)
at
javax.swing.plaf.basic.BasicFileChooserUI$ChangeToParentDirectoryAction.actionPerformed(BasicFileChooserUI.java:658)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1722)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1775)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:414)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:253)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:261)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:230)
at java.awt.Component.processMouseEvent(Component.java:4906)
at java.awt.Component.processEvent(Component.java:4732)
at java.awt.Container.processEvent(Container.java:1337)
at java.awt.Component.dispatchEventImpl(Component.java:3476)
at java.awt.Container.dispatchEventImpl(Container.java:1399)
at java.awt.Component.dispatchEvent(Component.java:3343)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3302)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3014)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2967)
at java.awt.Container.dispatchEventImpl(Container.java:1373)
at java.awt.Window.dispatchEventImpl(Window.java:1459)
at java.awt.Component.dispatchEvent(Component.java:3343)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:439)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:131)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
If you had reselected the current directory, before you tried to move up one
directory, no exception is thrown and everything works fine.
This is not a usage problem! This is buggy behavior! "." is a valid pathname
on windows/solaris platforms, and the behavior is not consistent in the
JFileChooser.
Robert Evans
(Review ID: 126618)
======================================================================
- relates to
-
JDK-4869950 NPE if JFileChooser.setCurrentDirectory() called twice with non-canonical file
- Closed