Java JTable with frequent updates?

I am encoding a JTable that is capable of handling frequent updates. Usually this JTable has ~ 1000 data series, and some of the columns will be updated frequently because their values ​​are derived from the stock price, which moves a lot during market hours.

The problem I am facing is that when a large number of rows (e.g. 80%) are updated, the JTable becomes very slow for 20-30 seconds or so that the profiler shows that the EDT stream is extremely busy, processing tableChanged calls.

I'm trying to roll back the changes by 1) suppressing fireTableCellUpdated 2) If there are <= 50 rows, call fireTableRowUpdate for individual rows 3) If there are 50 rows of changes, calling fireTableDataChanged for the entire table.

This is better, but still slow, when there are frequent updates, I understand that fireTableDataChanged is also slow. Therefore, if the data is updated often enough, fireTableDataChanged will be called frequently, and the GUI will feel sluggish.

Can any of the subjects in this thread recommend best practices for using fireTableRowsUpdate, fireTableDataChanged, and fireTableStructureChanged to improve GUI viability and performance? If you have pointers to sample codes that solve this problem, it will be even better.

Many thanks

Anthony C

+2
source share
1 answer

, JTable perfs . : () , .

, Oracle , " ".

: " JTable, ":

http://www.oracle.com/technetwork/java/christmastree-138396.html

, , : .

, JTable , GC , .

, , , , . JTable, :)

yup, , JTable .

+6

Source: https://habr.com/ru/post/1732608/


All Articles