Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Operating System's Look & Feel in Java 7?

Tags:

I am coding Java 7 with the Netbeans 7.1 IDE. From the Java 1.7 package they are using a new theme in their applications.

What can I do to make my application's theme exactly the theme in operating system (i.e. if I am using Ubuntu, I want the look and feel of my program to be the that of Ubuntu's)?

like image 913
Chathura Widanage Avatar asked Feb 17 '12 16:02

Chathura Widanage


People also ask

How do I display my operating system?

Click the Start or Windows button (usually in the lower-left corner of your computer screen). Click Settings. Click About (usually in the lower left of the screen). The resulting screen shows the edition of Windows.

How do I find my OS in Control Panel?

You can also click the Start button and enter System in the search. Click System (Control Panel). A window will open displaying the version. Congratulations!

What computer operating system do I have?

Press the Windows key (at the bottom of the keyboard, looks like four squares) and R key at the same time to open the Run dialog box. Type in “winver.” Click OK. A window should open called About Windows that tells you which operating system you are using.


1 Answers

I feel that this is more a question for SO, but in short you should try something like :

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
like image 69
Seki Avatar answered Oct 07 '22 07:10

Seki