I am experimenting with the Java UIManager and the use of different Look and Feels. I am rapidly discovering that it is not simply a matter of setting the look and feel at the beginning of the applet and miraculously seeing the resulting changes to the UI. What I’m finding is that with certain LAF’s I will find odd unpredictable behaviors and failures. For example, when I set the font of a JLabel to Arial with a size of 8 and a face of bold, the resulting text will be a single dash “-” instead of the specified text using the Windows or Classic Windows LAF. In other cases, like the Mac LAF, the JTrees’s stop working (I’m implementing my application on a Windows platform). So I’m wondering, is there a set of steps that need to be followed when changing the Java LAF so that whatever LAF I chose, I can be assured of reliable and predictable behavior from the rest of Swing? Are only certain LAF’s robust and the rest are for only the brave at heart?
Thank you in advance for your response.
I do not know how to answer your question precisely. All I can do is to show how I am running my apps with different UIs, please see below. The example shows how I am installing one of Look and Feels from the Substance library.
As to the comment in the code regarding call to
SwingUtilities.updateComponentTreeUI(frame);I would guess it is needed when you are changing your Look and Feel when the application is already running.Hope it is of any help to you.