This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Java FX in Swing! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Java FX in Swing!" Watch "Java FX in Swing!" New topic
Author

Java FX in Swing!

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

Integrating JavaFX into Swing Applications

Interesting to note that FX has its own 'User' Thread, separate from the EDT. That is going to lead to an awful lot of invokeLater / runLater calls in a mixed application though.

Apart from that the usage appears to be fairly seamless, though the article isn't clear on whether Swing components can be added to a FX container (probably not!), nor how one would add more than one JFXPanel to the same Swing GUI.


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

Joined: Sep 08, 2007
Posts: 2926
    
  15

Darryl Burke wrote:Integrating JavaFX into Swing Applications

Interesting to note that FX has its own 'User' Thread, separate from the EDT. That is going to lead to an awful lot of invokeLater / runLater calls in a mixed application though.

Apart from that the usage appears to be fairly seamless, though the article isn't clear on whether Swing components can be added to a FX container (probably not!), nor how one would add more than one JFXPanel to the same Swing GUI.

This would help add JavaFX charts to the Swing and not rely on external APIs.


Mohamed Sanaulla | My Blog
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

Well, technically JavaFX is even more of an 'external API' than JFreeChart inasmuch as it requires its own runtime, not just a jar on the classpath. Also, it's presently Windows-only, not cross platform.

That said, I'm looking forward to learning more of FX 2.0 than I ever did JavaFX Script.
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2926
    
  15

Agree with you. Now that we need not learn a new syntax for JavaFX
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35237
    
    7
Darryl Burke wrote:Well, technically JavaFX is even more of an 'external API' than JFreeChart inasmuch as it requires its own runtime, not just a jar on the classpath.

I was hoping that it would become a regular external library like JMF - drop the jar file into the classpath, and start using it. Do you think it will be more complicated than that?


Android appsImageJ pluginsJava web charts
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2926
    
  15

Ulf Dittmer wrote:
I was hoping that it would become a regular external library like JMF - drop the jar file into the classpath, and start using it. Do you think it will be more complicated than that?


It has got different rendering engine for the components. Also a media engine, web engine for showing html content (Architecture). So its a run time which sits on top of the JVM. My guess is JavaFX runtime would be bundled with the newer releases of the JRE.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35237
    
    7
Mohamed Sanaulla wrote:It has got different rendering engine for the components. Also a media engine, web engine for showing html content (Architecture). So its a run time which sits on top of the JVM.

I don't understand how that implies that it needs to be any different than some other random jar file you drop in the classpath?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

I haven't downloaded the early access release, but there has to be some native component (probably in the form of a DLL or DLLs) which is why it's available only for Windows.
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Java FX in Swing!
 
Similar Threads
Insider's Guide to Mixing Swing and JavaFX
Newbie question: How to integrate JavaFx with Java
New forum - Java FX
Recommendations: Custom App Window
JavaFX 2.0 problem in integrating into GUI