• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bug in JFileChooser?

 
Robin Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy!

Consider this snippet of code:



My System Specs:
OS
MS WinXP Proff
Version 2002
SP 2

JDK
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b04)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b04, mixed mode, sharing)

When i run this code and reach a directory which is empty, and try to press space bar when the focus is on the blank area (from where we select files), the following exception gets thrown:

Exception occurred during event dispatching:
java.lang.IndexOutOfBoundsException: Invalid index
at javax.swing.DefaultRowSorter.convertRowIndexToModel(DefaultRowSorter.java:497)
at sun.swing.FilePane$SortableListModel.getElementAt(FilePane.java:525)
at javax.swing.JList.getSelectedValue(JList.java:2276)
at javax.swing.plaf.basic.BasicFileChooserUI$Handler.valueChanged(BasicFileChooserUI.java:500)
at javax.swing.JList.fireSelectionValueChanged(JList.java:1765)
at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1779)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:137)
at javax.swing.DefaultListSelectionModel.setValueIsAdjusting(DefaultListSelectionModel.java:668)
at javax.swing.JList.setValueIsAdjusting(JList.java:2110)
at javax.swing.plaf.basic.BasicListUI$Actions.actionPerformed(BasicListUI.java:1925)
at javax.swing.SwingUtilities.notifyAction
....

Is this a known JFileChooser bug?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The latest released version of Java 6 seems to be 1.6.0_03, so I'd say you're running a beta version of some kind. Have you verified this behavior with a released version? If not, I'd suggest taking this up with the J2SE developer's community.
 
Robin Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
The latest released version of Java 6 seems to be 1.6.0_03, so I'd say you're running a beta version of some kind. Have you verified this behavior with a released version? If not, I'd suggest taking this up with the J2SE developer's community.


Hi Ulf!

I'm running the Consumer JRE version - JDK6 uN!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!