JDK-6363114 : JfileChooser throws exception on selectin multiplefiles from a folder other than in which they exist
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-12-14
  • Updated: 2011-02-16
  • Resolved: 2005-12-14
Related Reports
Duplicate :  
Description
This is observed inthe b64 pit build for mustang rc.
JFileChooser throws exception on selecting multiple files from a folder other than in which they exist.
Steps to reproduce
1)Open FileChooserDemo and select the radio button for Multiple selections. 
2)Open FileChooser and select two or more files with CTRl key pressed.
3)With the File view in the same directory click On Open - a dialog pops up with the names of the files which have been selected.
4)Open FileChooser, select 2 or more files with CTRl key pressed, and move the file view of the file chooser to the parent directory or to any other directory othe r than the current directory in which the two files are selected.
Observe that the 2 filenames now appear in the textfield of the filechooser.
5)Click on the open button.
Expected:
The filechooser opens up a dialogue with the 2 file names displayed in it. 
Observed:
The following exception occurs. 
----------------------------------
$ java -jar FileChooserDemo.jar
Exception occurred during event dispatching:
java.lang.IndexOutOfBoundsException: Invalid index
        at javax.swing.DefaultRowSorter.convertRowIndexToView(DefaultRowSorter.java:424)
        at sun.swing.FilePane.setFileSelected(FilePane.java:1341)
        at sun.swing.FilePane.doSelectedFileChanged(FilePane.java:1394)
        at sun.swing.FilePane.propertyChange(FilePane.java:1458)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:338)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:275)
        at java.awt.Component.firePropertyChange(Component.java:7690)
        at javax.swing.JFileChooser.setSelectedFile(JFileChooser.java:480)
        at javax.swing.JFileChooser.setSelectedFiles(JFileChooser.java:509)
        at javax.swing.plaf.basic.BasicFileChooserUI$ApproveSelectionAction.actionPerformed(BasicFileChooserUI.java:903)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1957)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2280)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:377)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:232)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
        at java.awt.Component.processMouseEvent(Component.java:5957)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3282)
        at java.awt.Component.processEvent(Component.java:5722)
        at java.awt.Container.processEvent(Container.java:1960)
        at java.awt.Component.dispatchEventImpl(Component.java:4365)
        at java.awt.Container.dispatchEventImpl(Container.java:2018)
        at java.awt.Component.dispatchEvent(Component.java:4195)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4222)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3886)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3816)
        at java.awt.Container.dispatchEventImpl(Container.java:2004)
        at java.awt.Window.dispatchEventImpl(Window.java:2300)
        at java.awt.Component.dispatchEvent(Component.java:4195)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.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:1032)
        at java.awt.Dialog$2.run(Dialog.java:1078)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Dialog.show(Dialog.java:1076)
        at javax.swing.JFileChooser.showDialog(JFileChooser.java:722)
        at FileChooserDemo.actionPerformed(FileChooserDemo.java:399)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1957)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2280)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:377)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:232)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
        at java.awt.Component.processMouseEvent(Component.java:5957)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3282)
        at java.awt.Component.processEvent(Component.java:5722)
        at java.awt.Container.processEvent(Container.java:1960)
        at java.awt.Component.dispatchEventImpl(Component.java:4365)
        at java.awt.Container.dispatchEventImpl(Container.java:2018)
        at java.awt.Component.dispatchEvent(Component.java:4195)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4222
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3886)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3816)
        at java.awt.Container.dispatchEventImpl(Container.java:2004)
        at java.awt.Window.dispatchEventImpl(Window.java:2300)
        at java.awt.Component.dispatchEvent(Component.java:4195)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.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)

----------------------------------
This is happening on metal & windows look & feel.

Comments
EVALUATION Before calling getRowSorter().convertRowIndexToView(...) make sure that the index is valid *** (#1 of 1): [ UNSAVED ] ###@###.###
14-12-2005