Hi,

This one is a little strange. Apparently the plastic laf overrides
getIconForTab(int) and returns null in certain cases. But then it still
calls paintIcon on it. I cannot find too much documentation on this, but
this seems the correct thing to do:

2005-11-21  Mark Wielaard  <[EMAIL PROTECTED]>

    * javax/swing/plaf/basic/BasicTabbedPaneUI.java (paintIcon): Only
    paint icon when not null.

Comments?

This is the last patch needed to get Emir to start up.
http://gnu.wildebeest.org/~mark/emir.png

Cheers,

Mark
Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.30
diff -u -r1.30 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java	18 Nov 2005 21:57:37 -0000	1.30
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java	21 Nov 2005 23:55:01 -0000
@@ -1881,7 +1881,8 @@
   protected void paintIcon(Graphics g, int tabPlacement, int tabIndex,
                            Icon icon, Rectangle iconRect, boolean isSelected)
   {
-    icon.paintIcon(tabPane, g, iconRect.x, iconRect.y);
+    if (icon != null)
+      icon.paintIcon(tabPane, g, iconRect.x, iconRect.y);
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to