Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Newbie question: How to integrate JavaFx with Java

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22649
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic