Caching JTable rows

2019-08-14 06:44发布

Is it possible to cache all row renderers so that each row is rendered just once after table updates? I am not expecting much data.

1条回答
别忘想泡老子
2楼-- · 2019-08-14 07:18

JTable renderers serve the view; an RTL renderer should have no perceptible overhead unless your model's getValueAt() implementation imposes it. Instead, let your TableModel acquire its data, caching only if necessary. This example extends AbstractTableModel and acquires its entire data on construction. If acquisition will impose a delay, use an instance of SwingWorker, as shown in the API or in this example.

查看更多
登录 后发表回答