JDK-6449933 : Vista:FileChooserDemo throws an exception when trying to open it in Windows L&F
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2_18-rev,5.0,6
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2008,windows_vista
  • CPU: x86
  • Submitted: 2006-07-18
  • Updated: 2011-02-22
  • Resolved: 2006-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_19-revFixed 6 b96Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
Vista:FileChooserDemo throws an exception when trying to open it in Windows L&F.
I was able to reproduce this on mustang b91 and could trace it back to mustang b53. 
On mustang b51 it worked fine. 
This appears on Vista b5456 Ultimate 32bit, which is the latest build we have.
I could not reproduce this on Vista b5365 64bit and Vista b5384 32bit.

Steps to reproduce:

Run the FileChooserDemo and switch to Windows L&F. 
OR 
Run the FileChooserDemo with L&F set to Windows L&F as below:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel -jar FileChooserDemo.jar 

The following stacktrace is produced. 
------
------
z:\disk09\jdk\1.6.0\b90\binaries\win>bin\java -showversion -jar demo\jfc\FileChooserDemo\FileChooserDemo.jar
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b90)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b90, mixed mode)

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3184
        at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:797)
        at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:274)
        at sun.awt.shell.ShellFolder.get(ShellFolder.java:218)
        at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$LazyWindowsIcon.createValue(WindowsLookAndFeel.java:2040)
        at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:199)
        at javax.swing.UIDefaults.get(UIDefaults.java:144)
        at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
        at javax.swing.UIDefaults.getIcon(UIDefaults.java:426)
        at javax.swing.UIManager.getIcon(UIManager.java:615)
        at javax.swing.plaf.basic.BasicFileChooserUI.installIcons(BasicFileChooserUI.java:237)
        at javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(BasicFileChooserUI.java:219)
        at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:135)
        at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:127)
        at javax.swing.JComponent.setUI(JComponent.java:648)
        at javax.swing.JFileChooser.updateUI(JFileChooser.java:1756)
        at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1206)
        at javax.swing.SwingUtilities.updateComponentTreeUI(SwingUtilities.java:1197)
        at FileChooserDemo$OptionListener.actionPerformed(FileChooserDemo.java:657)
        at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1237)
        at javax.swing.JComboBox.setSelectedItem(JComboBox.java:564)
        at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:600)
        at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:813)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
        at java.awt.Component.processMouseEvent(Component.java:5999)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3240)
        at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
        at java.awt.Component.processEvent(Component.java:5764)
        at java.awt.Container.processEvent(Container.java:1984)
        at java.awt.Component.dispatchEventImpl(Component.java:4407)
        at java.awt.Container.dispatchEventImpl(Container.java:2042)
        at java.awt.Component.dispatchEvent(Component.java:4237)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3912)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
        at java.awt.Container.dispatchEventImpl(Container.java:2028)
        at java.awt.Window.dispatchEventImpl(Window.java:2411)
        at java.awt.Component.dispatchEvent(Component.java:4237)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
        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)
------
------

Comments
EVALUATION This was fixed for mustang and then backported to 5.0u11. The fix for 5.0u11 is more robust. I've opened a new CR to apply that version to dolphin and 6.ux (6489447).
02-11-2006

SUGGESTED FIX In ShellFolder.cpp, in the native implementation of Win32ShellFolder2.getFileChooserBitmapBits(), an extra attempt should be added to get the bitmap with the newly introduced name IDB_TB_SH_DEF_16.
21-07-2006

EVALUATION The bug caused by the changes Microsoft made in build 5456: they renamed the bitmap 216 contained in shell32.dll and used by JFileChooser's native code, to semi-explanatory symbolic name IDB_TB_SH_DEF_16.
21-07-2006