File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes Is JavaFX only for internet applications? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Is JavaFX only for internet applications?" Watch "Is JavaFX only for internet applications?" New topic
Author

Is JavaFX only for internet applications?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

It seems wherever I read about it it talks about RIA(Rich Internet Applications) so is this all it does? I was reading on here it's going to replace swing? Does that mean it's a better gui builder than swing? Is the code java code, or is it different? I know there was JFX Script which was 1.0 I believe, and now 2.0 is in the API, so I would assume it's just normal Java code?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4540
    
    5

Jay Orsaw wrote:It seems wherever I read about it it talks about RIA(Rich Internet Applications) so is this all it does?

No. Have you taken a look at the documentation and samples linked from that page?

Jay Orsaw wrote:I was reading on here it's going to replace swing?

Where?

Jay Orsaw wrote:Does that mean it's a better gui builder than swing?

Depends what exactly you mean by a "GUI builder" -- JavaFX does have a superior rendering engine, various Effects and then there's FXML for specifying a JavaFX user interface through XML.

Jay Orsaw wrote:Is the code java code, or is it different?

It's Java code. Java, as pertaining to the programming language and platform, is a proper noun.

Jay Orsaw wrote:I know there was JFX Script which was 1.0 I believe, and now 2.0 is in the API, so I would assume it's just normal Java code?

Correct, except that there was never any JFX Script that I was aware of. There was JavaFX Script.


luck, db
There are no new questions, but there may be new answers.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

JavaFX may not be replacing right away. But much of the development efforts would be focussed on JavaFX - that's what all the reports from Javaone 2011 stated.


Mohamed Sanaulla | My Blog
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Yeah i was reading the documents and such, i believe it did say desktop application somewhere. I kind of answered most of my questions by reading around, but to add to what you answered about the gui builder and it replacing swing...

As you said the effects and rendering engine are great, but what i should have asked is how will it work with swing? Awt to me seems like the older style, and swing newer ( i believe there is something about lightweight/heavyweight containers or something like that? No idea what they mean :p).

Also about the gui builder, on netbeans page for JavaFX there is something for 6.9 and a gui builder that looks really amazing. Im sorry i didnt specify clearly exactly what i was referring to. I also cannot link the location currently since im on my phone... i will update when my internet is back up

As for swing being replaced by JavaFX http://www.coderanch.com/t/555539/Java-FX/java/JavaFX- Mohamed says that they are going to stop working on Swing and focus on FX. So we can assume that it will replace Swing according to Mohamed's info?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

Jay Orsaw wrote: As for swing being replaced by JavaFX http://www.coderanch.com/t/555539/Java-FX/java/JavaFX- Mohamed says that they are going to stop working on Swing and focus on FX. So we can assume that it will replace Swing according to Mohamed's info?

JavaFX and Swing would co-exist. Not like they can replace Swing because of the applications which have been built using Swing. But its not useful either to improvise and develop 2 different UI packages.

Jay Orsaw wrote: Also about the gui builder, on netbeans page for JavaFX there is something for 6.9 and a gui builder that looks really amazing. Im sorry i didnt specify clearly exactly what i was referring to. I also cannot link the location currently since im on my phone... i will update when my internet is back up


I am not sure if the builder was hugely popular. But then when I was worked on JavaFX long back (1 and early 1.2 time) there wasn't any builder. But there are few reports which say that development of a new GUI Builder is in progress OR its been completed OR its in its final stages.

Jay Orsaw wrote: As you said the effects and rendering engine are great, but what i should have asked is how will it work with swing? Awt to me seems like the older style, and swing newer ( i believe there is something about lightweight/heavyweight containers or something like that? No idea what they mean :p).

You can embed JavaFX content into Swing using a special panel. You can read about it in the tutorial here. Few developers have been putting in effort to embed Swing content into JavaFX(Read: thingsfx.com)
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Mohamed Sanaulla wrote:
Jay Orsaw wrote: As for swing being replaced by JavaFX http://www.coderanch.com/t/555539/Java-FX/java/JavaFX- Mohamed says that they are going to stop working on Swing and focus on FX. So we can assume that it will replace Swing according to Mohamed's info?

JavaFX and Swing would co-exist. Not like they can replace Swing because of the applications which have been built using Swing. But its not useful either to improvise and develop 2 different UI packages.

Jay Orsaw wrote: Also about the gui builder, on netbeans page for JavaFX there is something for 6.9 and a gui builder that looks really amazing. Im sorry i didnt specify clearly exactly what i was referring to. I also cannot link the location currently since im on my phone... i will update when my internet is back up


I am not sure if the builder was hugely popular. But then when I was worked on JavaFX long back (1 and early 1.2 time) there wasn't any builder. But there are few reports which say that development of a new GUI Builder is in progress OR its been completed OR its in its final stages.

Jay Orsaw wrote: As you said the effects and rendering engine are great, but what i should have asked is how will it work with swing? Awt to me seems like the older style, and swing newer ( i believe there is something about lightweight/heavyweight containers or something like that? No idea what they mean :p).

You can embed JavaFX content into Swing using a special panel. You can read about it in the tutorial here. Few developers have been putting in effort to embed Swing content into JavaFX(Read: thingsfx.com)


I feel like they left AWT alone and just worked on Swing, and the same is happening to JavaFX. Once you get better, the rest seem to die out. I would hope that they would co-exist on a great level because FX wont take over right away, and swing is a MAJOR component.

I really like the gui builder netbeans offers normally. Having to not type out the code for 140 menu items is enough for me to use the builder .

Thank you sirs for your responses!
Cole Terry
Ranch Hand

Joined: Nov 23, 2011
Posts: 45
Hello guys,

I am currently interested in JavaFX 2.0, as I intend to upgrade a Swing app to JavaFX. Is it easier to replace Swing's buttons, text fields, labels on a JPanel by JavaFX equivalent components?
I have read an article on how to add JavaFX UI to Swing app, but look like it requires adding a completely new JFXPanel kind of thing into a JFrame, that would mean I may have to rewrite the GUI completely (

What do you think guys?
Patrick Martin
Greenhorn

Joined: Apr 01, 2012
Posts: 6
Cole Terry wrote:Hello guys,

I am currently interested in JavaFX 2.0, as I intend to upgrade a Swing app to JavaFX. Is it easier to replace Swing's buttons, text fields, labels on a JPanel by JavaFX equivalent components?
I have read an article on how to add JavaFX UI to Swing app, but look like it requires adding a completely new JFXPanel kind of thing into a JFrame, that would mean I may have to rewrite the GUI completely (

What do you think guys?


It depends on what you are looking to do. If your intent is to test the waters with JavaFX 2.x, I would recommend downloading the 2.1 developer release and rewriting the application entirely in the latest incarnation of JavaFX. This will allow you to fully appreciate where this space is moving towards.

I think that you will find that you can achieve more with less code. I think the components appear much more polished in JavaFX as well. However, there are some rough edges currently, but I have been amazed at how usable JavaFX 2.0/2.1 are. The main thing I find to be missing is the wealth of existing component libraries and GUI builders like you would find in the Swing environment, but that's to be expected in a new platform.

Good luck!

- Pat
Patrick Martin
Greenhorn

Joined: Apr 01, 2012
Posts: 6
Jay Orsaw wrote:It seems wherever I read about it it talks about RIA(Rich Internet Applications) so is this all it does? I was reading on here it's going to replace swing? Does that mean it's a better gui builder than swing? Is the code java code, or is it different? I know there was JFX Script which was 1.0 I believe, and now 2.0 is in the API, so I would assume it's just normal Java code?


JavaFX uses a theater based on Stages and Scenes where the Stage abstracts away the differences in where the application is deployed.

So, in theory, the same application can run equally well within a browser or on the desktop as a result of this Stage metaphor/abstraction. The applet would, I guess, be the Stage for an internet application.

Having said that, I've only used JavaFX to run applications locally on the desktop and I have been quite happy with performance. Components such as file-choosers which were a bit sluggish in Swing run much faster within JavaFX from my experience.

I think that Swing and JavaFX will coincide for the foreseeable future. I predict that the cloudy future of Swing will drive more folks to JavaFX or away from the uncertainty of the Java GUI platform altogether. At some point, I would suspect that Oracle would stop investing in evolving Swing and simply port it from release to release.

Having said that, I think that finally after many years, JavaFX is on the right track with the 2.x roadmap. The winding path that it took to get here has lost it some credibility. However, Oracle seems to have finally decided a direction for the platform and seems to be fully committed to it's success. I was never a fan of learning JavaFX Script. I want to stay in Java, not spend time learning tiny domain specific languages.

- Pat
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Patrick Martin wrote:
Jay Orsaw wrote:It seems wherever I read about it it talks about RIA(Rich Internet Applications) so is this all it does? I was reading on here it's going to replace swing? Does that mean it's a better gui builder than swing? Is the code java code, or is it different? I know there was JFX Script which was 1.0 I believe, and now 2.0 is in the API, so I would assume it's just normal Java code?


JavaFX uses a theater based on Stages and Scenes where the Stage abstracts away the differences in where the application is deployed.

So, in theory, the same application can run equally well within a browser or on the desktop as a result of this Stage metaphor/abstraction. The applet would, I guess, be the Stage for an internet application.

Having said that, I've only used JavaFX to run applications locally on the desktop and I have been quite happy with performance. Components such as file-choosers which were a bit sluggish in Swing run much faster within JavaFX from my experience.

I think that Swing and JavaFX will coincide for the foreseeable future. I predict that the cloudy future of Swing will drive more folks to JavaFX or away from the uncertainty of the Java GUI platform altogether. At some point, I would suspect that Oracle would stop investing in evolving Swing and simply port it from release to release.

Having said that, I think that finally after many years, JavaFX is on the right track with the 2.x roadmap. The winding path that it took to get here has lost it some credibility. However, Oracle seems to have finally decided a direction for the platform and seems to be fully committed to it's success. I was never a fan of learning JavaFX Script. I want to stay in Java, not spend time learning tiny domain specific languages.

- Pat


It seems like FX is the way to go, 2.0 seemed like it was a good start, and now with 2.1 out it should be getting better and better. Apparently they are stopping support on Swing now though? I guess it's time to move forward!!!

I am basically recreating a program in Java and it has a gui interface/ works with 3D(Open GL). So would you think I should goto FX instead of Swing? Can Open GL and FX work together, or is there even a point to? FX's 3d is nice, but Open GL is everywhere, and IDK how the future will look on these 2... Any help would be appreciated!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4540
    
    5

Jay Orsaw wrote:Apparently they are stopping support on Swing now though?

I don't see support for Swing being removed in the foreseeable future. Swing has been declared to be in maintenance mode, which means that the only code changes will be bug fixes. Read my lips: No new API.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Darryl Burke wrote:
Jay Orsaw wrote:Apparently they are stopping support on Swing now though?

I don't see support for Swing being removed in the foreseeable future. Swing has been declared to be in maintenance mode, which means that the only code changes will be bug fixes. Read my lips: No new API.


So would you say switching to JavaFX now would be a wise decision, or that FX/Swing's uses depend on what you are trying to accomplish?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

My impression is that Java FX is still a work in progress (other opinions welcome). However my opinion is also that they are indeed working on it.

So in the short term you might find that you're assisting in identifying bugs in the product as well as your own bugs. But in the longer term, I suspect Java FX might be a good bet, since Oracle seems to be behind it. One thing about Swing: it has good tutorials. I see that Java FX has tutorials too, but I haven't looked at them at all.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Paul Clapham wrote:My impression is that Java FX is still a work in progress (other opinions welcome). However my opinion is also that they are indeed working on it.

So in the short term you might find that you're assisting in identifying bugs in the product as well as your own bugs. But in the longer term, I suspect Java FX might be a good bet, since Oracle seems to be behind it. One thing about Swing: it has good tutorials. I see that Java FX has tutorials too, but I haven't looked at them at all.


Yeah Swing will be good for awhile until FX takes over. FX is much nicer IMO just by looking at the sample demo from 2.0. Lots of abilities, better engine, it seems like it's the way to go, but we will see how it will work with swing and everything else, as there seems to be some limitations. I also want to see how it will work with Open GL like Swing/AWT/SWT does...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is JavaFX only for internet applications?