Is Java Swing still in use? is the most recent post I found, and it is 4 years old (now 8 years old), so...
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.
(I am not asking about a Swing-AWT comparison...just whether or not Swing is obsolete in the workforce.)
Absolutely yes. Legacy swing applications are still supported and enhanced. There is no alternative for that. And if you are making applications like IDE's, SWING is still preferred. New application will of course have web-interfaces , but that really depends on the nature of the application. No generic rules.
Majority of existing GUI java codebases are
Swing
and likely will stay that way until the codebase rots and nobody maintains it anymore.Majority of new GUI java codebases are using
JavaFX
, which is theSwing
replacement inJava8
and is part of thestandard java library
now. It allows forCSS
skinning,HTML5
elements, and also has a very niceFXML
(a dialect of XML/HTML) which allows non-programmers to "get in there" and work on the GUI layout, etc. It also hasSceneBuilder
which is a free/standard GUIdrag-n-drop
builder which auto-generatesFXML
for your program.I kid not when I say
FXML
can replace 3,000 lines ofextended JFrame class
code for aSwing
GUI, with 50 lines ofFXML
. (recent project I helped migrate).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.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
vsFrame
, etc.Well, Intellij IDEA uses Swing for its UI, so I would not say that it is obsolete. Granted, I really think it could use a huge overhaul (read: something not full of spaghetti code).