java桌面应用程序和javafx有什么区别? [英] what is the difference between java desktop application and javafx?

查看:585
本文介绍了java桌面应用程序和javafx有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通Java桌面应用程序(使用AWT或Swing)和使用JavaFX构建的Java应用程序之间有什么区别?



有什么优点和每个的缺点?

解决方案

我认为你所问的是构建JavaFX桌面应用程序的优缺点是什么? Java Swing桌面应用程序。在尝试了两者后,我可以指出一些差异:



Java Swing



优点:




  • 更好的视觉设计师和IDE支持

  • 更多全功能控件集

  • 适用于在数据库之上构建业务应用程序(如用户界面),而不需要标准(和第三方)控件之外的功能。



  • 缺点




    • 多媒体支持不足

    • 构建自定义控件或自定义外观非常困难

    • 没有动画支持

    • Java语法对于构建UI可能很尴尬。 IDE使这不是一个问题,但是如果你必须手动做任何事情就会变得很难看。



    JavaFX



    优点




    • 体面的多媒体支持

    • 易于构建自定义控件,所有现有控件都可以使用CSS进行换肤(虽然我还没有尝试过CSS)。

    • 动画支持很好 - 不太像虽然很好,但它足以用于基本动画。

    • 语法似乎更适合构建UI,特别是手动编码 - 这很好,因为你需要手工编写它们。 / li>
    • 适合构建需要自定义外观的多媒体应用程序或应用程序。



    缺点




    • 视觉设计师需要工作,我个人不会使用它。根据您的需要,这可能是一个很大的负面因素。

    • 仍然缺乏一些控制,但这种情况正在好转。确实存在的控件似乎运行良好。

    • 存在Swing集成,但他们正在努力更改引擎,以便它不再依赖于Swing。目前尚不确定使用JavaFX的Swing控件对未来有多好。所以我不会在可能的情况下避免在JavaFX中使用Swing控件。


    What is the difference between a "normal" Java desktop application (with AWT or Swing), and a Java application built with JavaFX?

    What are the advantages and disadvantages of each?

    解决方案

    I think what you are asking is what are the pros and cons of building a JavaFX desktop application vs a Java Swing desktop application. After experimenting with both I can point out a few differences:

    Java Swing

    Pros:

    • Better visual designer and IDE support
    • More full featured set of controls
    • Good for building business applications such as user interfaces on top of a database where you don't need capabilities beyond the standard (and third party) controls.

    Cons

    • Poor multimedia support
    • Building custom controls or custom skins is very difficult
    • No animation support
    • Java syntax can be awkward for building UIs. The IDE makes this less of an issue, but if you ever have to do anything manually it can get ugly.

    JavaFX

    Pros

    • Decent multimedia support
    • Easy to build custom controls, and all existing controls are skinnable using CSS (I haven't tried CSS yet though).
    • Animation support is good - not quite as good as flash but its good enough for basic animations.
    • The syntax seems better suited for building UIs, especially for hand coding them - which is good because you will need to hand code them.
    • Good for building multimedia applications or applications where you need a custom look.

    Cons

    • The visual designer needs work, and personally I don't use it. This can be a big negative depending on your needs.
    • Still lacking in some controls, but this is getting better. The controls that do exist seem to work well.
    • Swing integration exists, but they are working on changing the engine so that it no longer relies on Swing. It is uncertain how well using Swing controls from JavaFX will work on the future. So I wouldn't avoid the use of Swing controls in JavaFX when possible.

    这篇关于java桌面应用程序和javafx有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆