I.2 Nimbus Look-and-Feel

In our screen captures, we use Java’s elegant Nimbus cross-platform look-and-feel. There are three ways that you can use Nimbus:

  1. Set it as the default for all Java apps that run on your computer.

  2. Set it as the look-and-feel at the time that you launch an app by passing a command-line argument to the java command.

  3. Set it as the look-and-feel programatically in your app.

We set Nimbus as the default for all Java apps. To do so, you must create a text file named swing.properties in the lib folder of both your JDK installation folder and your JRE installation folder. Place the following line of code in the file:


swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

For more information on locating these installation ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.