1

I'm transitioning some tables from Swing to FX.

I am trying to create a custom horizontal oriented TableView kind of like what is asked about here.

I utilized this method to wrap and display my column of data. I did a bind between two table scrollbars to get a "row header". Here is what the entire thing looks like:

enter image description here

Then I checked how well TableView handled loading a large amount of data. I created a basic multiplication table with 10 columns and 100,000 rows. After the initial load-in, the table was incredibly responsive and the vertical scrollbar movement and had no issue.

My issue came when I add more columns. I believe because of the way that TableView expects data to be in rows instead of columns that when I add 10,000 columns and 50 rows the entire TableView component was unresponsive. It also took significantly longer to load-in than the 10 columns, 100k rows.

At ~4k columns and 50 rows, the table responded well to the horizontal scroll, but the vertical was very slow to respond, which is why (apart from the inherent structure) I was lead to believe TableView prefers row data to column.

Is there a way around the unresponsiveness that preferably:

  • Keeps the columns as the dataset
  • Doesn't involve going back to JTables
  • Avoids pagination

I found this post, but it did not seem helpful and the OP went back to JTables in the end. On the other hand, this was 4 years ago and a slightly different case.

Please note I am new to posting so let me know if more info is needed.

tb_codes
  • 11
  • 5
  • It's a bit different and may not be right for you as it has different functionality, but perhaps, instead of a TableView, try a [ControlsFX GridView](https://controlsfx.bitbucket.io/org/controlsfx/control/GridView.html) and see if you can get the performance you need. – jewelsea Aug 02 '17 at 22:56
  • The example cited is a proof-of-concept; you might [profile](http://stackoverflow.com/q/2064427/230513) it to see what can be optimized for your particular use case. – trashgod Aug 03 '17 at 00:52
  • @jewelsea I did start using SpreadsheetView from ControlsFX, but it seems like it instantiates a lot of the TableView in the background and GridView was not going to be powerful enough for what I had in mind. FX just seems incredibly restrictive when it comes to customization in comparison to Swing. – tb_codes Aug 09 '17 at 14:49

0 Answers0