Java: Setting Native Look and Feel

Here is a little bit of code that I use to make all my Java programs display the host computer’s native user interface theme:


try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e)
{
System.out.println("Error setting native look and feel:"+e);
}

For further reading on the topic, here is a link to Sun’s website describing the topic in detail.

About Noble Bell

I am a computer software and Internet developer of 25+ years. I have a degree in electronics engineering too. I love God, I am a born-again Christian. I love my family too. I enjoy writing software, reading, sports, outdoor activities, and playing games.
This entry was posted in Java Programming. Bookmark the permalink.

2 Responses to Java: Setting Native Look and Feel

  1. Noble Bell says:

    Yes, it actually works pretty well. I found another cool java class that is more suited for native look and feel on Mac that I am getting ready to try out. I will post the findings here of course. ;)

  2. Good find, man! I was never fond of the non-native spin Java puts on a lot of GUI apps. This makes them a little more “home-y.”

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>