java桌面应用程序和javafx有什么区别?
“普通”Java 桌面应用程序(使用 AWT 或 Swing)和使用 JavaFX 构建的 Java 应用程序之间有什么区别?
各自的优点和缺点是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为您要问的是构建 JavaFX 桌面应用程序与 Java Swing 桌面应用程序的优缺点是什么。在尝试了两者之后,我可以指出一些差异:
Java Swing
优点:
缺点
JavaFX
优点
缺点
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:
Cons
JavaFX
Pros
Cons
与 Swing 相比,JavaFX 的改进速度更快,并且变得更好用。
JavaFX 是一个 GUI 框架,具有多种优点,包括动画和 CSS 集成。这可以帮助创建许多您可以在 CSS3 中看到的 2D 和近 3D 内容。
JavaFX 是纯 Java,因此除了您熟悉的旧 Java 之外,您无需学习其他语言。 JavaFX 是我最喜欢的桌面和企业 GUI 平台,我只在处理较旧的应用程序环境(即与硬件集成)时使用 Swing。据我所知,唯一的缺点是场景构建器尚未集成,使用控件和 API 需要一些脑力劳动,但这很小。
对我来说,Java 桌面和 JavaFX 之间没有区别,因为 JavaFX 可用于开发桌面应用程序、企业应用程序和小程序。您可以查看当前的 JavaFX 版本来检查其功能。
JavaFX is improving faster and becoming better to use than Swing.
JavaFX is a framework for the GUI with several benefits, including animations and CSS integration. This can help in creating a lot of the 2D and near-3D stuff you can see in CSS3.
JavaFX is pure Java, so you need not learn another language other than the good old Java you know. JavaFX is my favorite GUI platform for desktop and enterprise, and I only use Swing when dealing with older application environments (i.e. integrating with hardware). The only disadvantage I know of is that the scene builder is not yet integrated, and using the controls and API requires some brain work, but this is minor.
For me there is no difference between Java desktop and JavaFX since JavaFX can be used to develop desktop apps, enterprise apps, and applets. You can look into the current JavaFX versions to check out its capabilities.
这并不是一种劣势/优势,而是了解每种产品可以提供什么以及老话“使用正确的工具完成工作”。
雅虎答案的答案此答案的来源:
javaFX实际上是一种不同的语言(类似,但语法不同),但它在 JVM 上运行并且可以使用 Java 类。主要针对“RIA”(富互联网应用程序)开发,跨多种设备。相当多的内置功能可用于开发奇特的功能和功能。华丽的用户界面,无需使用 Java 等更具体(低级)的语言进行所有打字操作。
确实,“比较”有点困难; JavaFX 利用了 Java 和 JavaFX 的所有优点。在此基础上构建了一个用于开发 RIA 的平台。
来源:
Javafx wikiepdia
javafx 概览
javafx 主页
类似的 stackoverflow 问题
Its not a disadvantage/advantage situation as much as understanding what each can provide and the old saying "use the right tool for the job".
Answer from yahoo answers Source for this answer:
javaFX is actually a different language (similar, but different syntax), but it runs on a JVM and can use Java classes. Mainly developed for "RIA" (rich Internet applications), across a variety of devices. Quite a few built-in features for developing fancy & flashy user-interfaces, without all the typing one has to do in a more nuts-n-bolts (low-level) language like Java.
Really, it's kinda hard to "compare"; JavaFX leverages all the advantages of Java & builds a platform on it for developing RIA's.
Source(s):
Javafx wikiepdia
javafx at a glance
javafx homepage
similar stackoverflow question
JTable 类是另一个在 AWT 中没有等效项的 Swing 组件。 JTable 提供了非常灵活的创建和显示表的可能性。让我们从对象的数组或向量或实现 TableModel 接口的对象构建表。
JTableModel 接口定义了指定表内容的对象的方法。 AbstractTableModel 类提供了一个实现 JTableModel 预定接口的方法。此类通常经过扩展以提供模型表的自定义实现。
JTable 类提供编辑表的功能。方法setCellEditor()允许将TableCellEditor接口的对象识别为编辑器表格单元格。
The JTable class is another Swing component that has no equivalent in AWT. JTable provides a very flexible possibility to create and display tables. Lets build tables from arrays or vectors of objects or from objects that implement the TableModel interface.
The JTableModel interface defines methods for objects that specify the contents of a table. The class provides an implementation AbstractTableModel the JTableModel predetermined interface. This class is typically extended to provide a custom implementation of model table.
The JTable class provides the ability to edit tables. the method setCellEditor () allows an object of the interface is TableCellEditor identified as the editor table cells.