[Schmitzm-commits] r1940 - branches/2.6.x/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 10 20:53:05 CEST 2012


Author: alfonx
Date: 2012-04-10 20:53:05 +0200 (Tue, 10 Apr 2012)
New Revision: 1940

Modified:
   branches/2.6.x/schmitzm-core/src/main/java/de/schmitzm/swing/JPanel.java
Log:
Backport eines Fix mit setTitleColor der eine NPE mit Java7 herbeif?\195?\188hrte...



Modified: branches/2.6.x/schmitzm-core/src/main/java/de/schmitzm/swing/JPanel.java
===================================================================
--- branches/2.6.x/schmitzm-core/src/main/java/de/schmitzm/swing/JPanel.java	2012-04-04 21:49:12 UTC (rev 1939)
+++ branches/2.6.x/schmitzm-core/src/main/java/de/schmitzm/swing/JPanel.java	2012-04-10 18:53:05 UTC (rev 1940)
@@ -117,7 +117,7 @@
 	 */
 	@Override
 	public void setEnabled(boolean enabled) {
-		
+
 		// Color changing may not be done twice, even if setEnabled(false)
 		// is called multiple times.
 		if (enabled != isEnabled() && getBorder() instanceof TitledBorder) {
@@ -131,12 +131,13 @@
 			} else {
 				// We are disabling this component
 				backupColor = tb.getTitleColor();
-				tb.setTitleColor(backupColor.brighter().brighter());
+				if (backupColor != null)
+					tb.setTitleColor(backupColor.brighter().brighter());
 			}
 		}
 
 		super.setEnabled(enabled);
-		
+
 		// Passing it down to all sub-components
 		for (Component c : getComponents())
 			c.setEnabled(enabled);



More information about the Schmitzm-commits mailing list