diff options
author | Roman Kennke <roman@kennke.org> | 2005-04-19 06:36:27 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-04-19 06:36:27 +0000 |
commit | 4821f3090c0edaacc5f2730ac79d30612ec6b4b6 (patch) | |
tree | b0596663de7a931911104fcb08e7ade656cec8e2 /libjava/javax | |
parent | 8fe0225bf820ca31efe6f5b348866b93fe2c387b (diff) | |
download | gcc-4821f3090c0edaacc5f2730ac79d30612ec6b4b6.zip gcc-4821f3090c0edaacc5f2730ac79d30612ec6b4b6.tar.gz gcc-4821f3090c0edaacc5f2730ac79d30612ec6b4b6.tar.bz2 |
UIManager.java: Make the UIManager respect the swing.defaultlaf system property.
2005-04-19 Roman Kennke <roman@kennke.org>
* javax/swing/UIManager.java:
Make the UIManager respect the swing.defaultlaf system
property.
From-SVN: r98389
Diffstat (limited to 'libjava/javax')
-rw-r--r-- | libjava/javax/swing/UIManager.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java index dfc6a82..dee67d9 100644 --- a/libjava/javax/swing/UIManager.java +++ b/libjava/javax/swing/UIManager.java @@ -83,7 +83,26 @@ public class UIManager implements Serializable 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. |