We are currently migrating a swing application to JavaFX. The application makes heavy use of TableViews. We have 17 table views that are updated constantly many times a second each.
Users can scroll, and select as the table views are being updated.
In JavaFX we have the following blockers:
- Very slow ui behaviour when these tables are being updated. We have had to slow down the rate of updates to the table views as otherwise the whole ui slows to a crawl.
- Single Cell selection flickers every time a row is added to a table view which looks very unprofessional - http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8177945
- If you scroll down a table view and let go of the mouse, every additional row to the table view causes the table to scroll slightly. This makes the table view appear as if it is slowly scrolling when new rows are being added when it should be completely still. http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8178297
- The JavaFX table view does not provide the drag selection behaviour of the swing table view out of the box.
We have been forced to use a java agent with a ClassFileTransformer to intercept class loading to replace the VirtualFlow class with our modified version but this is less than ideal.
More details to the above bullet points:
- It seems that JavaFX calls layoutChildren every time a row is added, whether that row is within the view port or not which seems excessive when you have multiple table views being dynamically updated.
- We have raised a bug but has been given very low priority P3 targeted for v10 so don’t imagine this being fixed quickly. We have temporarily fixed this by doing a Toolkit.getToolkit().firePulse(); at the end of VirtualFlow.layoutChildren.
- We have raised a bug but has been given very low priority P3 targeted for v10 so don’t imagine this being fixed quickly. This seems to be caused by the code in VirtualFlow starting at 1159 where the function adjustPixelAmount is being called with floating point values. Take a look at the firstCellOffset and viewportTopToCellTop double variables. We have temporarily fixed this by rounding these values to integers.
- Our customers are used to being able to drag square selections in table views and to extend these selections by dragging outside of the boundary of the tableView. We have tried to implement a similar but incomplete behaviour by overriding TableColumn cellFactories and intercepting dragEntered events for table cells. But it is near impossible to mirror the dragging outside of the table view to extend the selection behaviour of the Swing table view.
My questions are:
Are these issues likely to be fixed? it doesn’t seem that JavaFX TableViews have been tested with tables that are being dynamically updated.
Is there a better way to patch issue 2 and 3 other than replacing the VirtualFlow class at class load time using a Java Agent?
Thanks
Danny