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
This commit is contained in:
Roman Kennke 2005-04-19 06:36:27 +00:00 committed by Michael Koch
parent 8fe0225bf8
commit 4821f3090c
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-04-19 Roman Kennke <roman@kennke.org>
* javax/swing/UIManager.java:
Make the UIManager respect the swing.defaultlaf system
property.
2005-04-19 Tom Tromey <tromey@redhat.com>
* java/lang/natVMClassLoader.cc (loadClass): Call resolveClass,

View File

@ -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.