[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug swing/26871] New: ImageIcon constructor throws exception when a non
From: |
avi at argo dot co dot il |
Subject: |
[Bug swing/26871] New: ImageIcon constructor throws exception when a nonexistent file is specified |
Date: |
25 Mar 2006 19:22:54 -0000 |
When calling the ImageIcon constructor with a nonexistent file name as a
parameter, the constructor throws an exception. The Sun JDK does not, and the
documentation suggests that this is the correct behavior.
import javax.swing.ImageIcon;
public class ImageIconTest {
public static void main(String[] args) {
new ImageIcon("foobar");
}
}
(the file "foobar" should not exist for the test)
Exception in thread "main" java.lang.IllegalArgumentException: Couldn't load
image: foobar
at gnu.java.awt.peer.gtk.GtkImage.<init> (lib-gnu-java-awt-peer-gtk.so.7)
at gnu.java.awt.peer.gtk.GtkToolkit.createImage
(lib-gnu-java-awt-peer-gtk.so.7)
at gnu.java.awt.peer.gtk.GtkToolkit.getImage
(lib-gnu-java-awt-peer-gtk.so.7)
at javax.swing.ImageIcon.<init> (libgcj.so.7)
at javax.swing.ImageIcon.<init> (libgcj.so.7)
at ImageIconTest.main (ImageIconTest)
This is with the classpath in gcc 4.1 in FC5 (gcc-4.1.0-3)
--
Summary: ImageIcon constructor throws exception when a
nonexistent file is specified
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: swing
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: avi at argo dot co dot il
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26871
- [Bug swing/26871] New: ImageIcon constructor throws exception when a nonexistent file is specified,
avi at argo dot co dot il <=