Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Where does the look and feel come from? Date: Mon, 22 Feb 2016 20:52:32 -0500 Organization: Aioe.org NNTP Server Lines: 62 Message-ID: References: NNTP-Posting-Host: ANasIS7Js9OyLQwgloeBLQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:33865 On 2/22/2016 3:56 PM, Eric Douglas wrote: > First, the javax.swing.UIManager.setLookAndFeel(), what is the > default value if I don't call this method? https://docs.oracle.com/javase/8/docs/api/javax/swing/UIManager.html says: Default look and feel The class used for the default look and feel is chosen in the following manner: 1. If the system property swing.defaultlaf is non-null, use its value as the default look and feel class name. 2. If the Properties file swing.properties exists and contains the key swing.defaultlaf, use its value as the default look and feel class name. The location that is checked for swing.properties may vary depending upon the implementation of the Java platform. Typically the swing.properties file is located in the lib subdirectory of the Java installation directory. Refer to the release notes of the implementation being used for further details. 3. Otherwise use the cross platform look and feel. > Should this be the same > on all systems running the same OS and/or the same JRE, or does this > pull from something like Windows themes? It depends on the look and feel. The name "cross platform look and feel" seems to indicate that it should be similar across anything. The documentation: https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/metal/MetalLookAndFeel.html sort of confirms that. > Second, where do the values come from, such as > UIManager.get("CheckBox.icon") should this return the same image on 2 > machines running the same OS and/or the same JRE with the same look > and feel, I have never played with that. I would expect that the answer is look and feel specific. I would expect that Metal would be the same anywhere but that the system default would change with the OS setting. Expect = I don't know and are just guessing. > or where would it get set? The look and feel could probably get the information from a config file or a database if it wanted to. It can also be set with the put method! :-) Arne