FIBS Board backgammon forum

FIBS Client software => JavaFibs => Topic started by: inim on November 19, 2005, 03:57:55 AM

Title: Look And Feel On Recent Mac Os X
Post by: inim on November 19, 2005, 03:57:55 AM
Hi,

i installed JavaFibs 1.008 for a friend on a Mac OS X 10.3 (Panther) and started it from the command line. Here is the Java version:


java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode)


I got this exception:


Class Not Found
java.lang.ClassNotFoundException: com.apple.mrj.swing.MacLookAndFeel
       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:219)
       at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1682)
       at javax.swing.UIManager.setLookAndFeel(UIManager.java:429)
       at z.a(z.java)
       at z.<init>(z.java)
       at JavaFIBS2001.main(JavaFIBS2001.java)

Class Not Found
java.lang.ClassNotFoundException: com.apple.mrj.swing.MacLookAndFeel
       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:219)
       at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1682)
       at javax.swing.UIManager.setLookAndFeel(UIManager.java:429)
       at z.a(z.java)
       at z.<init>(z.java)
       at JavaFIBS2001.main(JavaFIBS2001.java)



As a work around, we started the program from the GUI (where it worked) and looked at the "look and feel". Both Windows and Mac were greyed out. We set the PLAF to "Metal" and voila, both start methods worked.

I', not a Mac expert and just wanted to record this, may be my fault actually. Anyone on Mac has seen similar problems?

inim
Title: Look And Feel On Recent Mac Os X
Post by: inim on November 23, 2005, 12:33:24 AM
The error stayed after upgrading to JDK 1.4.2_09. But here is a hint i found on Apple Developer Network:

http://developer.apple.com/documentation/J.../TP40001901-SW1 (http://developer.apple.com/documentation/Java/Conceptual/Java14Development/04-JavaUIToolkits/JavaUIToolkits.html#//apple_ref/doc/uid/TP40001901-SW1)

QuoteIn Mac OS X, Swing uses apple.laf.AquaLookAndFeel as the default look and feel (LAF).

And a few lines later there is the notion of
Quote-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
to enable Metal PLAF. So i wonder if using -Dswing.defaultlaf=apple.laf.AquaLookAndFeel as a command line switch would do the trick to override Javafib's hardcoded Mac-PLAF com.apple.mrj.swing.MacLookAndFeel.

I think recent Mac OS X Javas may have changed the PLAF class, but i need help to verify it as I do not have access to a Mac at the moment.  Any help welcome.

inim
Title: Look And Feel On Recent Mac Os X
Post by: cthulhu on November 24, 2005, 12:53:25 AM
I love when they change things in the code without keeping backward compatibility.

Probably an easy fix will make it work for both. Thanks for reporting it. And I just had a new version almost set up for release. Guess I should include this fix too first though.

And no, you won't be able to override my hardcoded plaf with that line. Sorry.
Title: Look And Feel On Recent Mac Os X
Post by: cthulhu on November 24, 2005, 01:12:38 AM
Fixed. And now I only need someone to test it to see if it really works.