Commit 4821f309 by Roman Kennke Committed by Michael Koch

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
parent 8fe0225b
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,
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment