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.
-
http://stackoverflow.com/questions/16694948/swing-vs-javafx-for-desktop-applications – AntonH Apr 19 '14 at 11:46
-
http://stackoverflow.com/questions/1318645/javafx-or-swing – AntonH Apr 19 '14 at 11:46
-
the links are useful but they do not address my primary concerns regarding database connections and Jasper Reports. – user3245747 Apr 19 '14 at 12:38
-
I put the links more as starting points, until someone more knowledgeable on the subject comes along. – AntonH Apr 19 '14 at 12:39
-
Can you clarify "uses a lot of JTables... I have to start thinking about the user interface"? A `JTable` is a user interface component, so if you've created `JTable`s you've already started building the UI. – James_D Apr 19 '14 at 13:30
-
I have some tables in order to make sure that the program is functioning correctly, but I still haven't invested time in the user interface. Thats why Im asking which way is the way to go. – user3245747 Apr 19 '14 at 20:37
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

- 1,539
- 2
- 13
- 20
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).

- 321,522
- 82
- 660
- 783
JavaFx sure is the way of the future. BUT: It still has quite a few bugs and it's easy to create memory leaks with for example TableViews if you try to reuse the same objects with new contents.

- 46
- 4