classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] RFC: BasicTabbedPaneUI paint null Icon?


From: Mark Wielaard
Subject: [cp-patches] RFC: BasicTabbedPaneUI paint null Icon?
Date: Tue, 22 Nov 2005 01:03:43 +0100

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  <address@hidden>

    * 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);
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]