This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug SWING/22617] reopen 13414: ImageIcon("") throws IllegalArgumentException
- From: "timo dot lindfors at iki dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 22 Jul 2005 20:24:43 -0000
- Subject: [Bug SWING/22617] reopen 13414: ImageIcon("") throws IllegalArgumentException
- References: <20050722200029.22617.timo.lindfors@iki.fi>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From timo dot lindfors at iki dot fi 2005-07-22 20:24 -------
Aha, this bug does not happen if -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D is
specified. Quick'n'dirty fix could something like
Return GtkErrorImage() when image loading fails also when Graphics2D is not used.
---
/home/lindi/cp-src/2005-07-22T100134+0000/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java.~1.71.~ 2005-07-05 01:31:41.000000000 +0300
+++
/home/lindi/cp-src/2005-07-22T100134+0000/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java 2005-07-22 23:21:24.000000000 +0300
@@ -247,7 +247,11 @@
if (useGraphics2D())
return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage
(filename));
else
- return new GtkImage (filename);
+ try {
+ return new GtkImage (filename);
+ } catch (IllegalArgumentException e) {
+ return new GtkErrorImage();
+ }
}
public Image createImage (URL url)
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|reopen 13414: ImageIcon("") |reopen 13414: ImageIcon("")
|throws |throws
|IllegalArgumentException |IllegalArgumentException
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22617