AquaLaf setting?

Kevin kevin_m_miller at apple.com
Thu Oct 27 10:59:46 PDT 2011


On Oct 27, 2011, at 4:35 AM, Alexander Potochkin wrote:

> Hello Kevin
>> On Oct 26, 2011, at 11:10 AM, Alexander Potochkin wrote:
>> 
>>> Hello everybody
>>> 
>>> I wonder where in our code AquaLaF is set as the default Laf?
>>> 
>> The Aqua LaF is chosen by javax.swing.UIManager.getSystemLookAndFeelClassName() if the OSType is MACOSX and the current toolkit is LWCToolkit (otherwise, we use Metal).
> 
> UIManager spec tells the following:
> 
> * The class used for the default look and feel is chosen in the following
> * manner:
> * <li>If the system property <code>swing.defaultlaf</code> is
> *       {@code non-null}, use its value as the default look and feel class
> *       name.
> * <li>If the {@link java.util.Properties} file <code>swing.properties</code>
> *       exists and contains the key <code>swing.defaultlaf</code>,
> *       use its value as the default look and feel class name.
> * <li>Otherwise use the cross platform look and feel.
> 
> So if you don't use the property file by default, you should be setting swing.defaultlaf somewhere.

The swing.defaultlaf property is set (for MACOSX only) in javax.swing.UIManager.loadSwingProperties().  It will be overridden if the user specifies a default LaF at the command line. 

> 
> I wonder what piece of code is responsible for setting system properties like this one
> 
> Thanks much
> alexp
> 
>> 
>>> Is it read from some property file?
>>> (Didn't find swing.properties)
>>> 
>> We don't have a swing.properties file by default.  If the user creates the swing.properties file and specifies a different default LaF, we honor their choice.
>> 
>>> Thanks
>>> alexp
>> -Kevin
> 



More information about the macosx-port-dev mailing list