javafx 与java,java桌面应用程序和javafx有什么区别?

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值