aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/UIManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/UIManager.java')
-rw-r--r--libjava/classpath/javax/swing/UIManager.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/libjava/classpath/javax/swing/UIManager.java b/libjava/classpath/javax/swing/UIManager.java
index f4648f1e219..15a78190303 100644
--- a/libjava/classpath/javax/swing/UIManager.java
+++ b/libjava/classpath/javax/swing/UIManager.java
@@ -146,19 +146,29 @@ public class UIManager implements Serializable
LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
setLookAndFeel(laf);
}
+ else
+ {
+ setLookAndFeel(new MetalLookAndFeel());
+ }
}
catch (Exception ex)
{
System.err.println("cannot initialize Look and Feel: " + defaultlaf);
- System.err.println("error: " + ex.getMessage());
+ System.err.println("error: " + ex.toString());
System.err.println("falling back to Metal Look and Feel");
+ try
+ {
+ setLookAndFeel(new MetalLookAndFeel());
+ }
+ catch (Exception ex2)
+ {
+ throw (Error) new AssertionError("There must be no problem installing"
+ + " the MetalLookAndFeel.")
+ .initCause(ex2);
+ }
}
- currentLookAndFeel = new MetalLookAndFeel();
- currentLookAndFeel.initialize();
- currentUIDefaults = currentLookAndFeel.getDefaults();
-
}
-
+
/**
* Creates a new instance of the <code>UIManager</code>. There is no need
* to construct an instance of this class, since all methods are static.