Support for Apple Extensions

Will Herrmann wjherrmann at gmail.com
Fri Jul 5 12:16:41 PDT 2013


JavaFX has two included look and feels: Caspian and Modena. Both of them are nice, but like Swing's Metal and Nimbus, they are designed to look exactly the same way on every platform, which especially means that they clash on OS X.

Swing provided the ability to use the operating system's "native" LAF via "UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());" However, there is no equivalent to this in JavaFX, meaning that if you want something that looks closer to the native look and feel than Caspian or Modena, you have to use a third party class.

AquaFX is one such third party class that tries to bridge this gap via CSS skins, although it's my understanding that it is still undergoing some major revisions so I would be reluctant to use it in a production environment. There are similar third party projects to replicate other platform LAFs, such as:

—JMetro, replicating Windows 8 (http://pixelduke.wordpress.com/2012/10/23/jmetro-windows-8-controls-on-java/)
—JavaFX native skins, replicating Mac OS 10.8 and Windows 7 (http://blog.software4java.com/?p=30)
—Some experimental button LAFs for iOS/Mac/Windows 7 (http://fxexperience.com/2011/12/styling-fx-buttons-with-css/)

However, if you want an app that looks native on every platform, you would have to combine these third party CSS skins, which may not be an easy thing to do. Ultimately, I think that JavaFX ought to support a native look and feel for each platform, similar to the Swing code provided above.

-Will Herrmann

On Jul 5, 2013, at 1:50 PM, Fabrizio Giudici wrote:

> On Fri, 05 Jul 2013 20:19:23 +0200, Will Herrmann <wjherrmann at gmail.com> wrote:
> 
>> Unfortunately, JavaFX does not support native look and feels. AquaFX goes a fair ways to bridging the gap, but it's not ideal and may not be suitable for production environments.
> 
> Can you elaborate, please?
> 
> -- 
> Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
> "We make Java work. Everywhere."
> http://tidalwave.it/fabrizio/blog - fabrizio.giudici at tidalwave.it



More information about the macosx-port-dev mailing list