AddHUDPanel addPanel = new AddHUDPanel(
this, session, presenceInfo, presenceInfo, Mode.INITIATE);
HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
final HUDComponent addComponent = mainHUD.createComponent(addPanel);
addPanel.setHUDComponent(addComponent);
addComponent.setPreferredLocation(Layout.CENTER);
addComponent.setName(BUNDLE.getString("Voice_Chat"));
addComponent.setIcon(voiceChatIcon);
mainHUD.addComponent(addComponent);
addComponent.addEventListener(new HUDEventListener() {
public void HUDObjectChanged(HUDEvent e) {
if (e.getEventType().equals(HUDEventType.DISAPPEARED)) {
}
}
});
PropertyChangeListener plistener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent pe) {
String propName = pe.getPropertyName();
if (propName.equals("ok") || propName.equals("cancel")) {
addComponent.setVisible(false);
}
}
};
addPanel.addPropertyChangeListener(plistener);
addComponent.setVisible(true);
}