문제

I use a SwingWorker to change a DefaultTableModel according to changes in a database. My question is: is it safe to add a ListSelectionListener and a TableModelListener to the DefaultTableModel in doInBackground(), or do they have to be added in done()?

도움이 되었습니까?

해결책

Any action that modifies any GUI component in any way should be performed on the EDT. You should be adding the listeners in done.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top