tags:

views:

265

answers:

1

What are necessary steps for converting Swing application to JavaFX? It would be interesting to know also about best practices for performing such task (i.e. problems that can be encountered and resolutions).

+2  A: 

I don't know if there are "best" practices there, as JavaFX is quite new and people are more busy making new JavaFX programs than converting old Java ones...

First, I would ask why you want/need to do that... Second, I would say it depends on the purpose and complexity of the Swing program. If that's a plain dialog, it shouldn't be hard. If it is a complex application with sub-panels, lot of pop-up dialogs, menus, MDI behavior with docking, etc., it might be hard to impossible to port...

Somehow, it might be better to rewrite the GUI from scratch, knowing that you have to either use a wrapper of Swing components in JavaFX, or limit yourself to the (currently) limited range of native JavaFX components.

Now, if your application was written with good principles, you can rewrite only the view and controller parts, and re-use (most of) the models / business logic as JavaFX can very well exploit Java classes.

PhiLho