OpendJDK Darwin Binaries Unsupported GTK LookAndFeel

Michael Franz mvfranz at gmail.com
Tue Oct 7 18:15:00 PDT 2008


Hi,

I was fooling around with the look and feels to see what they look like and
found that there are three installed but only two work.

LookAndFeelInfo[] lf = UIManager.getInstalledLookAndFeels();
        for (LookAndFeelInfo l : lf) {
            System.out.println(l.getClassName());
        }

prints:
javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.gtk.GTKLookAndFeel

However, if I execute this line:
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");

I get the following exception:
javax.swing.UnsupportedLookAndFeelException: [GTK look and feel -
com.sun.java.swing.plaf.gtk.GTKLookAndFeel] not supported on this platform


It seems that the static initializer of UIManger includes either the Windows
LAF or the GTK LAF, since OS X is not Windows the GTK is included.

Is there a way to check if GTK is installed on the system before including
it as a valid LAF?

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/bsd-port-dev/attachments/20081007/41a0e268/attachment.html 


More information about the bsd-port-dev mailing list