Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX/ Swing Compatibility?

 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might find this interesting to look at.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kemal Sokolovic wrote:You might find this interesting to look at.


Thanks !!!
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 268
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> 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
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic