-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.2.1
-
generic
-
generic
STEPS: JDK1.2.1 build "K" both Win32/Solaris
1. launch "SwingSet" on demo/jfc/SwingSet
2. "Choosers->File Chooser"
3. select "cow.gif"
Image is not displayed in thumbnail, but produce exception.
java.lang.IllegalArgumentException: Width (90) and height (-1) must be > 0
at java.awt.Image.getScaledInstance(Image.java, Compiled Code)
at SwingSet$FilePreviewer.loadImage(SwingSet.java, Compiled Code)
at SwingSet$FilePreviewer.propertyChange(SwingSet.java, Compiled Code)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java, Compiled Code)
at javax.swing.JComponent.firePropertyChange(JComponent.java, Compiled Code)
at javax.swing.JFileChooser.setSelectedFile(JFileChooser.java, Compiled Code)
at javax.swing.plaf.basic.BasicFileChooserUI$SelectionListener.valueChanged(BasicFileChooserUI.java, Compiled Code)
<..... CUT .....>
From stack trace, it looks like loadImage tried to shrink the size of "cow.gif" -- large gif image -- to thumbnail.
In JFileChooser, the exception should be caught. Preferred way is instead of output the exception, but show some warning in file chooser thumbnail area. Say, "image cannot fit".
[koushi.takahashi@japan 1999-03-12]