Sorting JTable causes NullPointerException

前端 未结 1 1176
天命终不由人
天命终不由人 2021-01-14 16:36

I have a JTable which, when the appropriate button is clicked, begins to fill with the results of a file tree walk that goes on in the background. This works fine.

I

相关标签:
1条回答
  • 2021-01-14 16:46

    Your code has a big problem that may explain what you observe: you are modifying your table model outside the EDT, which is evil.

    Since you are using a SwingWorker, you should try to use it completely correctly, e.g. use its publish API to call model.addRow().

    0 讨论(0)
提交回复
热议问题