Swing今天还在使用吗? [英] Is Swing Still in Use Today?

查看:235
本文介绍了Swing今天还在使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java Swing是否仍在使用?是我最近发布的帖子发现它已经4岁了(现在已经8岁了),所以...

Is Java Swing still in use? is the most recent post I found, and it is 4 years old (now 8 years old), so...

专业环境中使用Swing ?我是一名学生,想知道是否值得学习,或者是否已过去。

Is Swing used at all in a professional environment? I am a student, and wondering if it is worth learning, or if its day has passed.

(我不是在询问Swing-AWT比较......只是是否Swing在劳动力中已经过时。)

(I am not asking about a Swing-AWT comparison...just whether or not Swing is obsolete in the workforce.)

推荐答案

现有的大多数GUI java代码库都是 Swing 并且可能会保持这种状态,直到代码库腐烂并且没有人再维护它。

Majority of existing GUI java codebases are Swing and likely will stay that way until the codebase rots and nobody maintains it anymore.

new GUI java的大部分内容代码库使用 JavaFX ,这是 Java8 Swing 替换>现在是标准java库的一部分。它允许 CSS 皮肤, HTML5 元素,并且还有一个非常好的 FXML (一种XML / HTML方言),它允许非程序员进入那里并处理GUI布局等。它还有 SceneBuilder 这是一个免费/标准的GUI drag-n-drop 构建器,可为您的程序自动生成 FXML

Majority of new GUI java codebases are using JavaFX, which is the Swing replacement in Java8 and is part of the standard java library now. It allows for CSS skinning, HTML5 elements, and also has a very nice FXML (a dialect of XML/HTML) which allows non-programmers to "get in there" and work on the GUI layout, etc. It also has SceneBuilder which is a free/standard GUI drag-n-drop builder which auto-generates FXML for your program.

当我说 FXML 可以替换3,000行扩展的JFrame类 Swing GUI的代码,包含50行 FXML 。 (我帮助迁移的最近项目)。

I kid not when I say FXML can replace 3,000 lines of extended JFrame class code for a Swing GUI, with 50 lines of FXML. (recent project I helped migrate).

Swing 仍在大量使用,并将持续很长时间而 - 毕竟,它是Java漫长时间的唯一选择。 JavaFX 然而,令人耳目一新,非常值得学习。

Swing is still used heavily, and will continue to be for a long while -- after all, it was the only choice for Java for a loooong time. JavaFX, however, is refreshingly nice, and very-much-so worth learning.

暂且不论 - Swing构建在AWT之上 - AWT有很多问题,其中大部分被java项目(OpenJDK / Oracle)标记为不会修复。构建Swing是为了替换/修复AWT,但有时您会将AWT对象与Swing应用程序结合。哎呀,有时你会把Swing对象和你的JavaFX应用程序结合起来。我不打算学习AWT,如果你学习Swing,你大部分时间都在学习AWT。与Swing vs AWT最大的区别是Swing组件以字母 J 开头。 EX: JFrame vs Frame 等。

As an aside -- Swing builds ontop of AWT - AWT has a lot of problems, most of which are marked as "wont-fix" by the java project (OpenJDK/Oracle). Swing was built to replace/fix AWT, however sometimes you will marry AWT objects into your Swing application. Heck, you will sometimes marry Swing objects into your JavaFX application. I would not bother with learning AWT, if you learn Swing, you are learning AWT for the most part. The largest difference with Swing vs AWT is Swing components start with the letter J. EX: JFrame vs Frame, etc.

这篇关于Swing今天还在使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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