I know that this is a simple question but there is no better place to ask than stack overflow. I have been developing a Java desktop application which connects to a remote database and uses a lot of JTables and also jasper reports. I am up to the point when I have to start thinking about the user interface and it has come to my attention that I can use JavaFX for that. Based on some research that I have been doing, it seems that JavaFX offers superior user interface than SWING. My question is, is JavaFX suitable for my application? Can I use it when my application uses a lot of database queries, tables and jasper reports? or should I stick with SWING? If I should go with JavaFX, where do I start with regards to building an app which utilises JavaFX for the interface and Java for the behind the scenes code (books, websites)?Thanks.
3 Answers
For great GUI, I think you should use javafx. in java 8, javafx looks more stable now. You can use javafx control to you current swing application. About database interaction, if you have bulk data in any table then please do not try to fetch whole data to javafx tableview control as It will leads to "Insufficient memory" problem. always process your data in database and dont give load to JVM. so for bulk data, I suggest you can use current JTable but javafx is pretty cool you can start exploring it. start it from http://docs.oracle.com/javase/8/javase-clienttechnologies.htm
There is no specific issues to show database data in a JavaFX TableView.
One area that may be of concern is printing. I believe Jasper had built in stuff to print JTables and JTables also have a print method. Printing a multi-page TableView is more involved.
Also if you are not able to use Java 8 you won't get the latest improvement of the api (for example related to printing).
JTableis a user interface component, so if you've createdJTables you've already started building the UI. - James_D