aspose file tools*
The moose likes JavaFX and the fly likes Newbie question: How to integrate JavaFx with Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Newbie question: How to integrate JavaFx with Java" Watch "Newbie question: How to integrate JavaFx with Java" New topic
Author

Newbie question: How to integrate JavaFx with Java

Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
Hello,
I am a beginer in JavaFx.
I hava an existing desktop Swing application. I was wondering if it is posible to keep the existing code (the db access procedures, the "logic" etc.) and change only the SWING interface with a JavaFX one. I have found many tutorials about how to create a JavaFx interface (display elements etc.) but I don't really know how to "call" my old standard Java Code from it (ex: when I click an Fx button to trigger the code previously written for a SWING listener).


Can you please help me?

Thanks in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

It's been a while since I've done any JavaFX work, but I believe that JavaFX for the desktop can use anything from Java SE, including database connectivity. This will prevent your application from being portable; it probably won't be able to run on mobile phones or TVs et all.

As for how, do you know how to call a method from a button trigger? Calling a JavaFX method or a Java method won't be that different, as long as you have the right imports and you have an instance to call the method on (not needed for static methods).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tom Hite
Greenhorn

Joined: Mar 23, 2010
Posts: 2
Since JavaONE 2010, all JavaFX Script 1.X is deprecated. JavaFX Sciprt will be reincarnated as JavaFX 2.0 as a regular Java library sometime in Spring 2011. Then all Java JavaFX interactions will be moot. JavaFX Script was compiled with JavaFX compiler. But JavaFX 2.0 will be compiled with the Java compiler (javac). And JavaFX will be accessible from all languages on the VM as any Java Library might be. The question will be how much of the JavaFX Script functionality will survive in JavaFX 2.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie question: How to integrate JavaFx with Java
 
Similar Threads
Is JavaFX only for internet applications?
Essential JavaFX: Why No Real RIA?
What are the benefits of using JavaFx over Swing ?
Can Java FX be used for developing stand-alone GUI applications?
Insider's Guide to Mixing Swing and JavaFX