Results 1 to 15 of 15
  1. #1
    MW130 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    317
    Rep Power
    2

    Default JavaFX vs. Swing

    So, I know that oracle has released a statement saying that JavaFX will eventually replace Swing. What is the advantage of JavaFX? The new format, using "stage" instead of JFrame, seemed weird. Why is this change necessary? What benefit do we reap from JavaFX that Swing does not have?

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: JavaFX vs. Swing

    It's unlikely that Java FX will ever replace Swing. Swing is long established as "the" UI toolkit, and developers who know it well have little incentive to learn something new. Even new programmers will need to learn Swing, because it's guaranteed that you will encounter Swing code. Whatever the technical advantages JavaFX may be, it's too little, too late to make much difference.
    Get in the habit of using standard Java naming conventions!

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    Default Re: JavaFX vs. Swing

    Googling "javafx advantages over swing" returns a bunch of results.

    I've been a Swing developer for a decade now, but one of my goals this year is to check out JavaFX. Whether it actually replaces Swing depends on what people choose to use over the next couple years.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,600
    Rep Power
    5

    Default Re: JavaFX vs. Swing

    Same here. Been doing Java and Swing for a long time. But only this year have started to take a serious look at JavaFX.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    Default Re: JavaFX vs. Swing

    Here's a specific page outlining some of the advantages: JavaFX for Swing Developers: The JavaFX Advantage for Swing Developers | JavaFX 2 Tutorials and Documentation

    It seems like Oracle's latest decisions with applets and webstarts is at odds with their focus on JavaFX though. Why create a language for designing RIAs if most people can't run your RIAs?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,994
    Rep Power
    5

    Default Re: JavaFX vs. Swing

    Its really simple actually: JavaFX is still actively patched and expanded (for now...), Swing has been a sleeping API/toolkit for a long time now and any bug relating to it will have a very low priority.

    Nobody is forcing anyone to start using JavaFX over Swing, but if your Swing GUI misbehaves on Windows 8.1, you might be waiting quite some time before it is corrected.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: JavaFX vs. Swing

    There very first item on that "advantages" link is not something I would consider an advantage. A theoretical advantage, maybe, but not a practical one. Defining the UI in XML makes it much harder to write and maintain. This is really a limitation of the tools, not a fundamental problem. But that doesn't make it any less of a problem.

    Android takes a similar approach. When working on Android UI code in Eclipse, you have to manually compare entity names from the XML with their corresponding Java names when connecting the UI to the application logic. It's a big hassle, and will remain so until the API developers step up and write some decent plugins for Eclipse.
    Get in the habit of using standard Java naming conventions!

  8. #8
    MW130 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    317
    Rep Power
    2

    Default Re: JavaFX vs. Swing

    @Gimbal2, that's what worries me about continuing to learn Swing. On the other hand, JavaFX will be updated, but is not as widely known and ubiquitous in GUI or game programming. Maybe what would be best for making games would be Java2D?


    EDIT: Also, there are few tutorials for JavaFX

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,994
    Rep Power
    5

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by MW130 View Post
    @Gimbal2, that's what worries me about continuing to learn Swing. On the other hand, JavaFX will be updated, but is not as widely known and ubiquitous in GUI or game programming.
    In the old OTN forums, the JavaFX2 subforum was actually INCREDIBLY active; far more than I had expected. I don't follow the JavaFX subspace in the new ugly Jive monstrosity that Oracle has, so I wouldn't know how active it still is.

    Maybe what would be best for making games would be Java2D?
    Hell no. If you want to do 2D games, use LibGDX. Java2D has the same basic sleeper issues as Swing and it was never really designed for games anyway, but rather for user interfaces which don't require active updating and fast performance.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  10. #10
    MW130 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    317
    Rep Power
    2

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by gimbal2 View Post
    In the old OTN forums, the JavaFX2 subforum was actually INCREDIBLY active; far more than I had expected. I don't follow the JavaFX subspace in the new ugly Jive monstrosity that Oracle has, so I wouldn't know how active it still is.



    Hell no. If you want to do 2D games, use LibGDX. Java2D has the same basic sleeper issues as Swing and it was never really designed for games anyway, but rather for user interfaces which don't require active updating and fast performance.
    Is libGDx shipped with Java SE? Is it what most people use for games

    ?

  11. #11
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by MW130 View Post
    Is libGDx shipped with Java SE? Is it what most people use for games

    ?
    Did you try googling libGDX?

    LibGDX is a framework built on top of Java and OpenGL; it does not come with Java.

    If you're just starting out, I actually suggest checking out Processing first. It's another language built on top of Java that makes visualizations and interactions really easy, but you're learning Java syntax. From there you can dabble in Swing and Java 2D and eventually go on to more complicated frameworks like libGDX and LWJGL.

    The link in my signature to StaticVoidGames has tutorials that take you from Processing to Swing, might be worth checking out.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,994
    Rep Power
    5

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by MW130 View Post
    Is libGDx shipped with Java SE? Is it what most people use for games

    ?
    No, because most people don't use Java to make games. But among the few rebels who do use Java, LibGDX is quite popular.

    And I second the little hint that KevinWorkman put in his post: Google is your friend. Don't fall in the forum trap where you create a post and then expect all the answers to come out through that, most answers are a simple 2 second Google away.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  13. #13
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by gimbal2 View Post
    No, because most people don't use Java to make games.
    A lot of people who actually make there games use Java. But more importantly big games such as minecraft and runescape use it.As for weather its libGDX or not I do not know
    With the right know how, anything is possible

  14. #14
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,994
    Rep Power
    5

    Default Re: JavaFX vs. Swing

    Quote Originally Posted by Daryn View Post
    A lot of people who actually make there games use Java. But more importantly big games such as minecraft and runescape use it.As for weather its libGDX or not I do not know
    I don't know where you get your numbers from; but its a niche crowd. Most people use C++ or more recently C#. Minecraft is a big exception to the rule (and then only the PC version; the other iterations are done in other languages) and Runescape isn't even Java anymore as far as I know (or at least the front-end isn't).

    Where you would be more correct is if you start to count the age old applet things, then historically there were quite a few people that used Java indeed but that number is dwindling fast.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  15. #15
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,958
    Rep Power
    8

    Default Re: JavaFX vs. Swing

    Most big AAA titles use C or C++, mostly because that's what the existing frameworks are for.

    Most indie titles use Unity, and a surprising number actually use Game Maker.

    But the Java game development scene is still very much alive, and I think you'd be surprised by how many libGDX games are out there.

    I recommend checking out JGO if you haven't already: Featured Games - Java-Gaming.org

    But like I said, IMHO the best way to learn is to start with Processing, work your way through Swing, and then after you understand objects and models and whatnot, go on to using frameworks like libGDX and developing for Android.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Need Help with JavaFX
    By incredibleX in forum New To Java
    Replies: 4
    Last Post: 01-22-2014, 05:07 PM
  2. JavaFX Book | Learn JavaFX More In Depth
    By SnakeDoc in forum JavaFX
    Replies: 0
    Last Post: 05-17-2013, 11:10 PM
  3. JavaFX 2.0 and/or Swing
    By JavaPete in forum Forum Lobby
    Replies: 2
    Last Post: 10-25-2012, 09:36 AM
  4. Help with javaFX?!
    By JavaNoob!1 in forum JavaFX
    Replies: 7
    Last Post: 07-18-2012, 10:56 PM
  5. JavaFX Script and JavaFX Mobile
    By levent in forum Java Software
    Replies: 1
    Last Post: 01-27-2010, 04:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •