Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在实现一个带有大量数据的swing jtable,我希望在数据模型中的getValueAt时刻加载数据并在单元格中打印“正在加载”并稍后返回数据,我不想执行查询在 UI 线程中。有什么想法吗?谢谢。
我正在实现一个带有大量数据的swing jtable,我希望在数据模型中的getValueAt时刻加载数据并在单元格中打印“正在加载”并稍后返回数据,我不想执行查询在 UI 线程中。有什么想法吗?谢谢
使用工人线程
Runnable#Thread, 输出到 XxxTableModel 必须包装到 invokeLater
Runnable#Thread
SwingWorker,方法publish(同步)、process(同步)、done(异步)的输出在 EDT 上完成
SwingWorker
publish
process
done