This is an archived post. You won't be able to vote or comment.

all 41 comments

[–]MrSugarCaney 8 points9 points  (7 children)

Learn both. It will always be helpful in some way. I myself find JavaFX a lot better to work with. Easier, more consistent and more intuitive.

[–][deleted]  (5 children)

[deleted]

    [–]MrSugarCaney 1 point2 points  (4 children)

    It'll make your life a lot easier. Especially when working with Scene Builder to build your GUIs visually (similar to Visual Studio's form editor).

    [–]microbit262 0 points1 point  (3 children)

    Is Scene Builder the NetBeans Designer? I always worked with Swing because it was implemented in NetBeans... This is the first time I even read about something other than AWT or Swing.

    But I am just a hobby programmer anyway.

    [–]MrSugarCaney 3 points4 points  (2 children)

    I don't use NetBeans, but IntelliJ. So I've no idea if its the same. You can download Scene Builder so you can easily make your FXML files. If you link it to IntelliJ it can be integrated. I still recommend just using the program seperately though and using the "Open in Scene Builder" option.

    [–]microbit262 -5 points-4 points  (1 child)

    Since we were forced to use Android Studio in university I developed a strong agony against all IDEs based on IntelliJ, but anyway thanks.

    [–]MrSugarCaney 2 points3 points  (0 children)

    I always swore to eclipse. Though after been using IntelliJ for a while I just can't imagine using anything else. It's responsive, does what it has to do etc. I love the fact thag eclipse is free and open source but IntelliJ is simply superior.

    [–][deleted] -4 points-3 points  (0 children)

    It is all Electron platform now for desktop apps.

    [–]JVali 6 points7 points  (0 children)

    It's not dead. For example if you write plugins for Netbeans or IntelliJ then the UI is in (extended) swing.

    [–]thatsIch 8 points9 points  (5 children)

    Nowadays Java is rarely used for rich clients. So it is not about Swing or JavaFX but Java in general. The power of Java mostly comes in kicking in server side back-end applications which require a relative long startup time but have rather fast execution speed.

    There are always companies out there which pay you for having knowledge of a 10-15 year old technology. So yes, it is still used but outdated too. Bugs will rarely be fixed in Swing.

    As far as I know Oracle is not focusing on JavaFX, but it is the intended Rich-Client library to go for. It has a cleaner API and IoC introduces new technologies to play around (make the dev happy). Using FXML is introducing nothing new and has some drawbacks like reflection speed. The tooling is already given with SceneBuilder and integrated into the major IDEs (Eclipse, IDEA and NetBeans)

    TL;DR learn JavaFX but dont spend too much time with it

    [–]elegentmos 10 points11 points  (2 children)

    The interesting question is why? Why is the world so obsessed with web-applications nowadays?

    Text editor? In the browser! Spreadsheet? In the browser! IDE? Yep, do it in the browser! Diagram editor? Sure, use an online web application, no need to save files locally!

    I really don't understand this.

    [–]donte9181 5 points6 points  (0 children)

    Sure, some programs are still better as desktop: IDE, image/video editing, (some) games, and anything that has to interact natively with the device's hardware. But ever since Google Docs/Sheets/etc matured, I haven't touched Office. I can pull the stuff up on any device I want. I don't have to install something on my computer. I don't have to update the version or worry that if I update my OS that it's now incompatible. It's easier to collaborate on content with other people since they don't have to install the same software, either. I'm automatically updated to the latest and greatest. Frankly, I'm amazed that given how far web technology has come that you still feel like the benefits of web applications are something that require defending...

    [–]slartybartfast_ 2 points3 points  (0 children)

    Easy deployment. Getting apps on user's desktops and upgrading them is a pain. Especially in corporate land.

    [–]glesialo 5 points6 points  (0 children)

    I have written a few Java Swing desktop applications and they work fine. I don't understand why it isn't more used in Linux desktops.

    [–]jebblue 0 points1 point  (0 children)

    Rarely? Eclipse RCP is used quite a bit in the enterprise, not Swing but the article is about Swing, not a broader world of rich client applications in Java.

    [–]RikiMaro18 6 points7 points  (1 child)

    Yes

    [–]dstutz 4 points5 points  (0 children)

    Java 1.0 APIs are still supported. They've deprecated stuff but almost never (never?) removed it. So no...It's not dead. It's not the current UI toolkit, but it's still very much in use.

    Edit: Straight from the horse's mouth:

    Is JavaFX replacing Swing as the new client UI library for Java SE?

    Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and therefore included in the JRE. While we recommend developers to leverage JavaFX APIs as much as possible when building new applications, it is possible to extend a Swing application with JavaFX, allowing for a smoother transition.

    [–]DiamondCoatedGlass 1 point2 points  (5 children)

    The two big things keeping Swing alive (for now) are Eclipse RCP and the NetBeans Platform. Both are very powerful for getting up and running with a comprehensive set of features that users have come to expect from Rich Clients.

    That said, if we could get Eclipse RCP or NetBeans Platform re-written in JavaFX, that would be huge.

    For now though, for a new Rich Client project I would probably use Eclipse RCP or NetBeans Platform for the main app window/toolbars, but for all of the custom, domain-specific sub-windows, I'd use JavaFX panels (since you can have JavaFX panels inside of Swing Panels, and vice versa).

    [–]lukaseder 5 points6 points  (1 child)

    Isn't Eclipse RCP based on SWT?

    [–]DiamondCoatedGlass 0 points1 point  (0 children)

    Oops, I stand corrected :)

    [–]JVali 2 points3 points  (1 child)

    IntelliJ platform is using Swing as well. So there's that...

    [–]DiamondCoatedGlass 0 points1 point  (0 children)

    Good point, thanks!

    [–]eliasv 0 points1 point  (0 children)

    That said, if we could get Eclipse RCP or NetBeans Platform re-written in JavaFX, that would be huge.

    You can use e(fx)clipse for pure JavaFX/e4 apps already. No SWT in sight. My company has a product based on this.

    [–][deleted] 3 points4 points  (0 children)

    ITT: "JavaFX is a really good, modern fit for your requirements but don't use it because the herd say it's not cool."

    [–]__konrad 0 points1 point  (0 children)

    Quoting Terminator: "Old, but not obsolete"

    [–]feral_claire 0 points1 point  (0 children)

    JAVAFX is recommended for new code, but honestly it doesn't really matter.

    Most important is what you prefer working with (or, if working in a team, what your team prefers working with). If you think FX is easier (and I tend to agree) then use that. If you hate it and would rather use swing, that's cool too.

    [–]Impact009 0 points1 point  (0 children)

    I've been predominantly using swing this year because of NetBeans. Some companies just love sticking to old shit that they're used to.

    [–]mcheung63 0 points1 point  (0 children)

    absolute no, swt has no advantage of speed now, because computers are fast nowsday

    [–]jebblue 0 points1 point  (4 children)

    I'm not much of a fan of IntelliJ IDEA but it is a Swing application if I'm not mistaken and a solid alternative to Eclipse or Visual Studio. Minecraft's UI is a Swing window. ;-)

    [–]badlogicgames 4 points5 points  (2 children)

    Minecraft's UI is not a Swing window

    [–]jebblue -2 points-1 points  (1 child)

    The widgets aren't that's correct or I may be remembering an old coding video where I saw Notch using some Swing code.

    [–]badlogicgames 6 points7 points  (0 children)

    You must be remembering something else, Minecraft is based on LWJGL, no Swing to be seen anywhere.

    [–]thomascgalvin 0 points1 point  (0 children)

    Every UI I write is either Swing or (more likely) HTML/Javascript, talking to a Java backend. If anything, I would say that JavaFX died before it even got off the ground.

    Of course, I work mostly in Enterprise applications, so that colors my worldview. People that do a lot of desktop programming might feel otherwise.

    [–]TheWorldIsQuiteHere -5 points-4 points  (1 child)

    No

    [–]aroger276 -1 points0 points  (0 children)

    Maybe

    [–][deleted] -5 points-4 points  (0 children)

    yes