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 folders visit

bit.ly/JavaInstallationInstructions

In addition to the standalone JRE, there is a JRE nested in your JDK’s installation folder. If you’re using an IDE that depends on the JDK, you may also need to place the swing.properties file in the nested jre folder’s lib folder.

If you prefer to select Nimbus on an app-by-app basis, place the following commandline argument after the java command and before the app’s name when you run the app:

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset