Roster Listener and tree : invalid thread use?

Hi i have has some problems with a tree to enable it to show peoples prescences after logging on. The tree loads with all the buddies and ther relevant details ie username , and presence ie avaliable :away etc. But i am having trouble forming a structure for the update of the tree when it receives a packet from another client to update it’'s prescence… A roster listener has been created in the main window with the roster. When the listener receivesa packet it states it is an invalid thread use ie

I am trying to find the best and most effective way of doing this any ideas , apologies for many minimal knowledge on this subject as i am not very knowlegable on the subject of threads ie slight newbie.

Cheers

teejab