void () { myTreeModel.addTreeModelListener(new TreeModelListener() { @Override public void treeNodesChanged(TreeModelEvent e) { assertIsDispatchThread(); } @Override public void treeNodesInserted(TreeModelEvent e) { assertIsDispatchThread(); } @Override public void treeNodesRemoved(TreeModelEvent e) { assertIsDispatchThread(); } @Override public void treeStructureChanged(TreeModelEvent e) { assertIsDispatchThread(); } }); }