开发者

Does JavaFX have a "native look and feel" option like Swing?

It's been a couple of year开发者_高级运维s since I've done any Java work, my last efforts were using Swing. I'm poking around with a cross-platform client app that will interact with a Rails web service. JavaFX is one of the options I'm considering, but I'm concerned at the out-of-the-box aesthetic. Does JavaFX have a native look and feel option for the JavaFX controls (not Swing)?

I'm getting the impression that if I want to build a line of business application in Java, I should probably stick with Swing which is a shame since I like some of the features of JavaFX like binding, a terse syntax, and easy support for REST client programming.


I haven't see that. At best, you can use the extensive support of CSS styling we got with 1.3 to mimic native look and feel, but that's a big job! Not even sure how to deal with various themes we got on modern systems...
I suppose the point of RIAs is to bring their own look or to be flexible enough to allow to do your own shinny look, not to look like a random bland application on your platform... :-)

(Now, if I like skinnable applications, I also appreciate GUI frameworks using native controls or looking as such, like Qt (vs. GTK+ for example), precisely to provide good old "bland" applications not breaking user experience.)


  • JavaFX 2.0 has only one Look by default that is called "Caspian".
  • With Java 8 a second one was introduced, called "Modena".

Both are cross-platform Look&Feels.

See announcement of Modena, with screenshots.

At the moment some developers create native Styles for JavaFX as OpenSource projects. You can find an overview here:

  • http://www.guigarage.com/2013/01/this-is-for-the-native-ones/

If you are interested in the Mac OS L&F (AquaFX) for JavaFX, here are some posts with previews:

  • http://www.guigarage.com/category/aquafx/


Native look and feel is not supported by Oracle in the default JavaFX 2.x distribution.

A proof of concept on button styles by one of the JavaFX developers demonstrates that JavaFX is flexible enough to generate widgets that look like native widgets.

For OS X, you can try the third party AquaFX style for JavaFX, which makes JavaFX applications look like native OS X applications. AquaFX appears quite complete and comprehensive to me.

There have been other 3rd party projects which partially create native look and feels for other platforms, but their coverage is currently nowhere near comprehensive.

Some third party projects (all of which seem currently experimental and incomplete) are:

  • JMetro in jfx-styles
  • javafx-native-themes (JavaFX look and feels for: default swing, iOS, windows 7...)


you could definitely embed some css in your application to make the javafx components look more like the standard swing look. With scene builder its actually really easy to get all your tags setup correctly.

Check this out http://docs.oracle.com/javafx/2/css_tutorial/jfxpub-css_tutorial.htm


Interesting thing is in javaFx is, you can give the rich look and feel to native application also.You can apply css to the javaFx components. Not only that you can embed the HTML Css and pages in JAVAFX application.Which i can feel great revolution in terms of UI building for Standalone applications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜