RFR: 8325154: resizeColumnToFitContent is slower than it needs to be
Laurent Bourgès
lbourges at openjdk.org
Tue Feb 6 00:03:50 UTC 2024
On Mon, 5 Feb 2024 09:45:25 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
> A side comment: the default implementation of resizeColumnToFitContent() is to iterate over all the rows, and I think this is not right. The UI locks up if the table has, let's say, 10,000,000 rows. I think in this case it should instead pick a reasonable limited range (maybe a max 1000 rows or so) of rows based on what's currently visible, so as not to lock up the UI. This might be a separate improvement.
Here is my jtable autofit column that uses sampling to avoid processing all rows:
https://github.com/JMMC-OpenDev/jmcs/blob/61db740407dce5b38301ff67a8a3d77aa84ad3fe/src/main/java/fr/jmmc/jmcs/gui/util/AutofitTableColumns.java#L199
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1358#issuecomment-1927600809
More information about the openjfx-dev
mailing list