Get your CodeRanch badge!*
The moose likes JavaFX and the fly likes JavaFX/ Swing Compatibility? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "JavaFX/ Swing Compatibility?" Watch "JavaFX/ Swing Compatibility?" New topic
Author

JavaFX/ Swing Compatibility?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

I'm just curious if there is still issues with Swing and FX being compatible? I have a a project I need to do graphing with, and FX has some cool graphs, which would be cool to use to add to an existing Swing project...

Also is there any Graphing libraries otherwise? I checked Google and it seems like there are a few, but not too sure about any of them... Thoughts?

Thanks!!

~Jay
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

You might find this interesting to look at.


The quieter you are, the more you are able to hear.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

Kemal Sokolovic wrote:You might find this interesting to look at.


Thanks !!!
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

You're welcome.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

Kemal Sokolovic wrote:You're welcome.


One thing I've been noticing is that you need to edit your swing code in FX style code with scenes and such? I tried to add an FX class to a SE project and it wouldn't work, even with the FX platform.. I tried to add all of my code to an FX project, which my FX code showed the imports as correct now, however it wouldn't run anything........ >(
John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 101
    
    7
> I tried to add all of my code to an FX project, which my FX code showed the imports as correct now, however it wouldn't run anything

Try using the JavaFX packaging tasks to package your Swing app with embedded JavaFX:
http://docs.oracle.com/javafx/2/deployment/deploy_swing_apps.htm#BACFDACD

There is also a JavaFX/Swing Interop example (with source code and a NetBeans project which builds out of the box) you should refer to if you have further issues:
http://www.oracle.com/technetwork/java/javafx/samples/index.html
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

John Damien Smith wrote:> I tried to add all of my code to an FX project, which my FX code showed the imports as correct now, however it wouldn't run anything

Try using the JavaFX packaging tasks to package your Swing app with embedded JavaFX:
http://docs.oracle.com/javafx/2/deployment/deploy_swing_apps.htm#BACFDACD

There is also a JavaFX/Swing Interop example (with source code and a NetBeans project which builds out of the box) you should refer to if you have further issues:
http://www.oracle.com/technetwork/java/javafx/samples/index.html



I think I figured it out.... Will update.


Edit: One thing that has been bothering me is that I cannot run my applet when I made JavaFX package. Apparently the fx code only works in those packages... So I was thinking can I import the files as a jar and use them in my none FX package, or will it not work? It wont work with having the FX JDK as my choice either.... .


When I add my files into the FX Package I get this error for images




I'm able to switch it back to the actual file path and it works... STUPID NETBEANS error .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaFX/ Swing Compatibility?
 
Similar Threads
Does your book cover JavaFX and FX script?
Java FX! why?
JSF Graph TAGs
Learning SWT/Swings - Is it worthy?
JSF Support for Pagincation and Chart