[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: UIManager fixes

Kaffe CVS cvs-commits at kaffe.org
Fri Apr 22 16:30:25 PDT 2005


PatchSet 5736 
Date: 2005/04/22 23:24:59
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: UIManager fixes

2005-04-22  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath:

        2005-04-17  Roman Kennke  <roman at kennke.org>

        * javax/swing/UIManager.java:
        Make the UIManager respect the swing.defaultlaf system
        property.

Members: 
	ChangeLog:1.3904->1.3905 
	libraries/javalib/javax/swing/UIManager.java:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3904 kaffe/ChangeLog:1.3905
--- kaffe/ChangeLog:1.3904	Fri Apr 22 23:23:24 2005
+++ kaffe/ChangeLog	Fri Apr 22 23:24:59 2005
@@ -4,6 +4,16 @@
 
 	2005-04-17  Roman Kennke  <roman at kennke.org>
 
+        * javax/swing/UIManager.java:
+        Make the UIManager respect the swing.defaultlaf system
+        property.
+
+2005-04-22  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath:
+
+	2005-04-17  Roman Kennke  <roman at kennke.org>
+
         * javax/swing/text/SimpleAttributeSet.java
         (addAttribute): Check for null and remove key in that case.
         This fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21064 .
Index: kaffe/libraries/javalib/javax/swing/UIManager.java
diff -u kaffe/libraries/javalib/javax/swing/UIManager.java:1.5 kaffe/libraries/javalib/javax/swing/UIManager.java:1.6
--- kaffe/libraries/javalib/javax/swing/UIManager.java:1.5	Sun Oct 24 13:39:15 2004
+++ kaffe/libraries/javalib/javax/swing/UIManager.java	Fri Apr 22 23:25:00 2005
@@ -83,7 +83,26 @@
   static LookAndFeel[] aux_installed;
   
   static LookAndFeel look_and_feel = new MetalLookAndFeel();
-    
+
+  static
+  {
+    String defaultlaf = System.getProperty("swing.defaultlaf");
+    try {
+      if (defaultlaf != null)
+        {
+          Class lafClass = Class.forName(defaultlaf);
+          LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
+          setLookAndFeel(laf);
+        }
+    }
+    catch (Exception ex)
+      {
+        System.err.println("cannot initialize Look and Feel: " + defaultlaf);
+        System.err.println("errot: " + ex.getMessage());
+        System.err.println("falling back to Metal Look and Feel");
+      }
+  }
+
   public UIManager()
   {
     // Do nothing here.




More information about the kaffe mailing list