# FreeGuide Look and Feel FAQ

## Contents

- Does FreeGuide support skins/themes?
- What are Looks and Feels?
- How do I set the L&F used by FreeGuide?
- How do I install new L&F's?
- What about the GTK+ L&F?
- Do I need to install GTK+ to use the GTK+ L&F?
- The GTK+ L&F sounds great, but it's not listed as available. Why not?
- I have Java 2 version 1.4.2 or above and I still don't see GTK+. What's wrong?
- Where can I get more GTK+ themes?
- My GTK+ theme doesn't look right (or doesn't work). What's wrong?
- So, how do I know if a GTK+ theme is supported?
- You said the GTK+ L&F supports themes. How do I change my theme?
- Why doesn't FreeGuide notice when I change my System GTK+ theme?
- Since I changed my L&F, FreeGuide seems slow. Why?
- Since I changed my L&F, FreeGuide seems to take 4.5ms longer to start up. Why?
- Where can I find more L&F's?
- How do I ask more questions?

## Does FreeGuide support skins/themes?

FreeGuide (starting with version 0.7) supports Java's Pluggable Look and Feel (L&F). Most of the available L&F's provide a single "look," but some, such as the GTK+ and Synth Looks and Feels, provide support for themes (skins).

## What are Looks and Feels?

Looks and Feels (L&F's) are a means by which a programmer or an end-user can change the appearance of a Java application without rewriting or recompiling the application.

## How do I set the L&F used by FreeGuide?

Select `Tools|Options` from the FreeGuide menu. The options for `Layout` include a combo box (drop down list) that lists all of the L&F's available on your system. Select the L&F you want to use and click the `OK` button.

If you have installed a L&F that FreeGuide was unable to identify, you may type its class name into the combo box. Note that you must provide the fully-qualified classname--one that includes several words separated by periods, such as `javax.swing.plaf.metal.MetalLookAndFeel`. The fully qualified classname should be given in the L&F's documentation.

If you type in the class name and nothing happens, FreeGuide is unable to find the specified class. Make sure you spelled the class name correctly. If everything is spelled correctly, make sure you installed the L&F correctly.

## How do I install new L&F's.

When you download a L&F, it should include instructions for installing the L&F. Some may have requirements that others do not; for example, some will require you to specify additional information on the command line to use the L&F. Therefore, it is important that you read the instructions that came with your L&F.

In all cases, however, the L&F must appear in FreeGuide's classpath. To include the L&F in the classpath, modify the shortcut you are using to start FreeGuide to include the `-classpath` command-line option. The command line should look something like those shown below (make sure you use the correct locations for your files):

For Windows

    javaw -classpath "C:\path\to\my\LookAndFeel.jar" -jar "C:\Program Files\FreeGuide\FreeGuide.jar"

Or, for Unix-like operating systems:

    java -classpath "/path/to/my/LookAndFeel.jar" -jar "/usr/share/freeguide/FreeGuide.jar"

## What about the GTK+ L&F?

The GTK+ L&F was designed to provide the look and feel of a native application developed with the GTK+ toolkit (as are many applications for Unix-like operating systems--such as GNU/Linux--and even some applications that run on Windows). Since the GTK+ toolkit provides support for themes (which are functionally equivalent to skins), the GTK+ L&F provides theme/skin support.

## Do I need to install GTK+ to use the GTK+ L&F?

No. The GTK+ L&F performs the work normally accomplished by GTK+ theme engines to allow its use on any system--regardless of whether the system uses (or even supports) GTK+. Therefore, as long as you have the GTK+ L&F available, you can use the GTK+ L&F. Note that you will also need to make GTK+ themes available to use different GTK+ themes.

## The GTK+ L&F sounds great, but it's not listed as available. Why not?

The GTK+ L&F is a brand-new addition to Java. It is only included in Java 2 version 1.4.2 and above. Make sure you have the right version of Java. You can determine your Java version by executing the following command from the Command Prompt or shell:

    java -version

If you're using Microsoft Windows, please see the next question.

## I have Java 2 version 1.4.2 or above and I still don't see GTK+. What's wrong?

Sun decided not to include the GTK+ L&F with the Java 2 Runtime Environment (JRE) for Windows. Currently, the only available option is to install the Java 2 Software Development Kit (SDK) for Windows. NOTE: You do not need the J2EE with J2SE package or the NetBeans IDE with J2SE COBUNDLE. You want J2SE SDK.

If you're not using Windows, you may be using an implementation of Java that was created by a vendor other than Sun Microsystems. If that's the case, you will need to download Sun's implementation of Java to get the GTK+ theme. If Sun doesn't provide a version for your platform, you're out of (legal) options.

## Where can I get more GTK+ themes?

GTK+ themes are available from a number of websites, including GNOME and freshmeat.net; however, make sure you download supported themes.

## My GTK+ theme doesn't look right (or doesn't work). What's wrong?

Currently, the GTK+ L&F only supports a subset of the themes available for GTK+. Themes must be GTK+ 2 themes and may only use the Default, pixmap, and/or bluecurve theme engines. What does all that mean? If you really want to know, I suggest you go to the GTK+ website and start reading. After all, this is a FreeGuide FAQ. :)

## So, how do I know if a GTK+ theme is supported?

In truth, the best way to find out is to try the theme. Even if the theme is not fully supported, you might like the results; and since it is a "Look and Feel," if you like the look and you like the feel, it works for you!

## You said the GTK+ L&F supports themes. How do I change my theme?

First, you'll need some themes. Once you've downloaded one or more themes to try, install the theme (as described in the next two paragraphs).

If you're using a Unix-like operating system, use the tool provided by your distribution vendor to install and select the theme. Now, simply start FreeGuide and, if you haven't already done so, select the GTK+ L&F and enjoy the new look. In general, themes are installed by extracting their files into the `${USER}/.themes` directory. If you do not have a tool for working with GTK+ themes, GTK Theme Switch 2 is a nice lightweight program for installing and selecting themes. Note: If you do not want to install and/or select the theme, you may follow the Windows instructions below.

If you're using Windows (or you don't want to install the theme on your Unix-like operating system), it's not necessary to install the theme. Extract the theme files to a directory, keeping each theme in its own directory, and keep all the theme directories together in a single directory to make them easy to find (I recommend using `C:\gtk` since it's short and easy to type).

Since most of the themes will be distributed in "tarballs" (a common way to distribute software for Unix-like operating systems), you will need an extraction tool that can handle tape archive files (tar files) and GZIP and/or BZIP2 compression. One such tool for Windows is 7-Zip.

Once you've extracted the themes, you're ready to use them. To do so, just specify the location of the `gtkrc` file in the `swing.gtkthemefile` system property on the command line, as shown below:

For Windows

    javaw -Dswing.gtkthemefile="C:\gtk\Theme Name\gtk-2.0\gtkrc" -jar "C:\Program Files\FreeGuide\FreeGuide.jar"

Or, for Unix-like operating systems:

    java -Dswing.gtkthemefile="${HOME}/.themes/Theme Name/gtk-2.0/gtkrc" -jar "/usr/share/freeguide/FreeGuide.jar"

## Why doesn't FreeGuide notice when I change my System GTK+ theme?

The GTK+ L&F is not actually using the GTK+ theme engine to draw components of FreeGuide. Instead, it performs the work normally done by the theme engine itself, but does not detect changes to the system-define theme. Therefore, to get FreeGuide to notice the change to your theme, simply restart FreeGuide. Note that future versions of the GTK+ L&F may support detection of changes to the system theme, but until then restarting FreeGuide is the only way to change themes.

## Since I changed my L&F, FreeGuide seems slow. Why?

Well, you can't get something for nothing--with the exception of good quality open source software, of course! Some L&F's are slower than others, some L&F's claim to be faster than the default Java L&F (Metal), so you might want to try experimenting with other L&F's. If you've got your heart set on the L&F you're using, you'll have to get used to its performance.

## Since I changed my L&F, FreeGuide seems to take 4.5ms longer to start up. Why?

The Java installation on your system specifies a default L&F to use when none is specifically requested. Therefore, when you start FreeGuide, Java uses its default L&F until FreeGuide changes the L&F to the one you specified in your preferences. If you tell Java to use your preferred L&F, FreeGuide won't need to change the L&F after startup.

To specify the L&F, you may either change your installation's default L&F (which will affect all Java programs you use) or specify the default L&F on the command line. To change your installation's default, edit the file `%JAVA_HOME%/lib/swing.properties` (you may have to create the file) and add the line (or edit the one starting with swing.defaultlaf to look like the following):

    swing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel

To change the default L&F for FreeGuide only, specify the L&F classname as the value for the `swing.defaultlaf` system property on the command line. The command line should look something like those shown below (make sure you use the correct locations for your files):

For Windows

    javaw -classpath "C:\path\to\my\LookAndFeel.jar" -Dswing.defaultlaf="javax.swing.plaf.metal.MetalLookAndFeel" -jar "C:\Program Files\FreeGuide\FreeGuide.jar"

Or, for Unix-like operating systems:

    java -classpath "/path/to/my/LookAndFeel.jar" -Dswing.defaultlaf="javax.swing.plaf.metal.MetalLookAndFeel" -jar "/ur/share/freeguide/FreeGuide.jar"

Note that the Metal L&F is most likely the default on your Java installation, so the above command lines and properties file would do nothing. Instead, use the fully qualified classname of the L&F you want to use. The fully qualified classname should be given in the L&F's documentation.

## Where can I find more L&F's?

Some sites, such as javootoo.com provide links to many different L&F's that are available for download under licenses varying from open source to proprietary commercial. You may also want to try a search on your favorite search engine, for example on Google.