这是我的代码:
try
{
multiUserChat.join(nickname);
Form form = multiUserChat.getConfigurationForm();
Form submitForm = form.createAnswerForm();
for (Iterator<FormField> fields = submitForm.getFields(); fields
.hasNext();) {
FormField field = (FormField) fields.next();
if (!FormField.TYPE_HIDDEN.equals(field.getType())
&& field.getVariable() != null) {
submitForm.setDefaultAnswer(field.getVariable());
}
}
submitForm.setAnswer("muc#roomconfig_publicroom", false);
submitForm.setAnswer("muc#roomconfig_persistentroom", true);
multiUserChat.sendConfigurationForm(submitForm);
}
//Catch
catch()
form = multiUserChat.getConfigurationForm()时出错了 表单为null,因此错误是“NullpointerException”
我也得到“这个房间从入口锁定,直到配置确认”
我的代码有什么问题吗?
注意:我正在使用Openfire服务器
感谢您的帮助。