Spark plugin development of contact list

I want to define my own contact list using plugin. I made reference to ContactList.java.Here is my codes:

addContactGroup(“计算机应用研究所”);

contactItem = new ContactItem(“llx”, null, “llx@win-jdff156qa2r”);

contactItem.setPresence(new Presence(Presence.Type.unavailable));

addContactGroup(“计算机应用研究所::部门1”);

addContactGroup(“研究所”);

addContactGroup(“计算机应用研究所::部门2”);

group = addContactGroup(“研究所::部门1::组1”);

group.addContactItem(contactItem);

group.setVisible(true);

I manually defined a contactItem and put it under the group (“研究所::部门1::组1”); However it can’t display the online statususer “llx”.

Double click the user “llx” , everything is ok. But it display not well in the mainPanel.


ExamplePlugin.java.zip (6339 Bytes)

anybody can help me?

your setting the Presence to offline:

contactItem.setPresence(new Presence(Presence.Type.unavailable));