Menu

Using Joxy - Debian

Willem3141 Thom Castermans

Instructions for Debian, Ubuntu and derivatives (to choose another distribution: [Using Joxy])

On this page, we will explain how to install Joxy and how to apply it to a program.

Getting Joxy

You should first get Joxy, in either one of the following ways:

Installing

You should put the .jar file that you obtained in the Java class path. This can be done either with the -cp switch, and by putting it in the /lib/ext folder of your Java Runtime Environment (JRE). Because the first option is very error-prone, we recommend the latter option.

In Debian and Ubuntu 12.04 the beforementioned /lib/ext folder is located in

/usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext

or

/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext

You will probably need to have root rights to copy to that folder. So you can copy the JAR file to this directory as follows:

  • In Debian:

    su
    Password: enter password
    cp joxy-0.0.3.jar /usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext/joxy.jar

  • In Ubuntu:

    sudo cp joxy-0.0.3.jar /usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext/joxy.jar
    Password: enter password

where we assume that joxy-0.0.3.jar is in your current working directory. If you are using Java 1.7, you can substitute java-7-openjdk for java-6-openjdk.

Now we have the Java code placed in the right directory, we still need to install the shared library containing the native code (the .so file). (This is not obligatory; the shared library only takes care of the native text rendering, and if it cannot be found, Joxy will fallback on default Java text rendering.) You will need to put the .so file in a folder on the Java library path. For Debian and Ubuntu, this is

/usr/lib/jni

Warning: We are not sure whether the pre-compiled shared library will work on other systems. If it doesn't, please try compiling it yourself.

Applying Joxy to a program

You can apply Joxy to a program in multiple ways.

  • Using a command line switch. You can use the command line option -Dswing.defaultlaf=joxy.JoxyLookAndFeel when starting the application to switch the look and feel to Joxy. For example:

    java -Dswing.defaultlaf=joxy.JoxyLookAndFeel -jar someprogram.jar

  • An application-specific way. Some programs set their own look and feel, and overwrite your command line options. An example is NetBeans. To use Joxy on NetBeans, use the -laf option that NetBeans provides itself.

  • Programming it in your application. If you want, you can provide your own applications with the Joxy Look and Feel. This can be done with

    UIManager.setLookAndFeel("joxy.JoxyLookAndFeel");

    and putting the Joxy JAR file in the class path.

Note: if you have compiled the shared library yourself, the compilation script will give you a list of directories on the Java library path. You can choose to put the library in any of these folders.

Warning: do not change the name of the shared library; else Joxy will not be able to find it.

Advanced

If you want to use Joxy on all Java programs, you can use the Swing defaults file. This is usually located in

/etc/java-6-openjdk/swing.properties

Open this file. If the file does not exist, you can create it.

Now you can add lines in this file of the format

setting=value

where setting is one of the following.

  • swing.defaultlaf sets the default LAF to the given value. That is, if a program does not ask to set the LAF, it will use this setting. For example,

    swing.defaultlaf=joxy.JoxyLookAndFeel

  • swing.systemlaf sets the system LAF to the given value. That is, if a program asks Java to use the native system LAF, it will use this setting. In the case of Joxy, this makes sense, because Joxy is actually meant to imitate the system's look-and-feel. For example,

    swing.systemlaf=joxy.JoxyLookAndFeel

  • system.installedlafs lets you set the list of LAFs that Java knows that are available. This works a bit different than the first two options. Programs are able to ask Java which LAFs are installed. This way, they can create a list of LAFs, for example in a menu, so that the user can choose one of them. By using this setting, you can make Java aware that the Joxy LAF is available. The problem is, if you use this setting, you will override any LAF that was in this list by default. So you will have to enumerate all LAFs and appending Joxy, for example as follows:

    swing.installedlafs=metal,nimbus,motif,gtk,joxy

    swing.installedlaf.metal.name=Metal

    swing.installedlaf.metal.class=javax.swing.plaf.metal.MetalLookAndFeel

    swing.installedlaf.nimbus.name=Nimbus

    swing.installedlaf.nimbus.class=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

    swing.installedlaf.motif.name=CDE/Motif

    swing.installedlaf.motif.class=com.sun.java.swing.plaf.motif.MotifLookAndFeel

    swing.installedlaf.gtk.name=GTK+

    swing.installedlaf.gtk.class=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

    swing.installedlaf.joxy.name=Joxy

    swing.installedlaf.joxy.class=joxy.JoxyLookAndFeel


Related

Wiki: Compiling the source
Wiki: Downloading the source
Wiki: Using Joxy

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.