<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Hi Mark,<br>
<br>
The default look and feel is Metal on all OS except for macOS where
the default is Aqua.<br>
<br>
You can modify the default look and feel using the the <code>swing.defaultlaf</code>
property, and it works for me as expected. The default look and feel
of an application is initialised to the class in the <code>swing.defaultlaf</code>
property.<br>
<br>
I ran a simple Java program on Windows:<br>
<br>
<pre>> <kbd>java DefaultLookAndFeel.java</kbd>
<samp>[<b>The Java(tm) Look and Feel</b> - javax.swing.plaf.metal.MetalLookAndFeel]
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
javax.swing.plaf.metal.MetalLookAndFeel</samp>
> <kbd>java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel DefaultLookAndFeel.java</kbd>
<samp>[<b>The Microsoft Windows Look and Feel</b> - com.sun.java.swing.plaf.windows.WindowsLookAndFeel]
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
javax.swing.plaf.metal.MetalLookAndFeel</samp></pre>
<br>
The <code>swing.defaultlaf</code> property is documented and is
used in the tutorial <a href="https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">How
to Set the Look and Feel</a>, specifically the section <a href="https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html#commandLine">Specifying
the Look and Feel: Command Line</a> has two examples how to modify
the default look and feel.<br>
<br>
If set the value to a class that doesn't exist, I'll get an
exception:<br>
<br>
<pre>> <kbd>java -Dswing.defaultlaf=NimbusLookAndFeel DefaultLookAndFeel.java</kbd>
<samp>Exception in thread "main" java.lang.Error: Cannot load NimbusLookAndFeel
at java.desktop/javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1390)
at java.desktop/javax.swing.UIManager.initialize(UIManager.java:1501)
at java.desktop/javax.swing.UIManager.maybeInitialize(UIManager.java:1467)
at java.desktop/javax.swing.UIManager.getLookAndFeel(UIManager.java:492)
at DefaultLookAndFeel.main(DefaultLookAndFeel.java:5)</samp></pre>
<br>
You can use these line numbers to study how default look and feel is
initialised.<br>
<br>
<br>
Please note the client-libs-dev mailing list is not a support forum,
it is place to discuss <i>development of client libraries</i>.<br>
<br>
-- <br>
Regards,<br>
Alexey<br>
<br>
<div class="moz-cite-prefix">On 2025-06-19 19:04, Ludwig, Mark
wrote:<br>
</div>
<blockquote type="cite" cite="mid:BL0PR07MB55888E0BDCA4A1E2B126D65AE07DA@BL0PR07MB5588.namprd07.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Aptos;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#467886;
text-decoration:underline;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Greetings,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We are in
the process of (finally) completing a migration from
AWT-based windows and dialogs to Swing-based that was
started in the 1990s.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Testing the
external Swing controls on Linux, we find nothing seems to
happen as a result of setting the “swing.defaultlaf” System
Property. This is documented in multiple places – at least
the javax.swing.UIManager doc, and the <b>How to Set the
Look and Feel</b> tutorial (and is mentioned in <a href="https://bugs.openjdk.org/browse/JDK-8159164" moz-do-not-send="true" class="moz-txt-link-freetext">
https://bugs.openjdk.org/browse/JDK-8159164</a>).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We find the
“swing.systemlaf” System Property is effective in changing
the returned value from
UIManager.getSystemLookAndFeelClassName(), but does not by
itself change the look-and-feel -- only with something like
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()),
which is documented.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We would
appreciate clarity on this discrepancy regarding the
“default” look-and-feel for Swing on Linux.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Mark Ludwig<o:p></o:p></span></p>
</div>
</blockquote>
<br>
The source of the sample app:<br>
<pre><code>import javax.swing.UIManager;
public class DefaultLookAndFeel {
public static void main(String[] args) {
System.out.println(UIManager.getLookAndFeel());
System.out.println(UIManager.getSystemLookAndFeelClassName());
System.out.println(UIManager.getCrossPlatformLookAndFeelClassName());
}
}</code></pre>
</body>
</html>