0
我已经创建了与订户和发布者的Java聊天。我试图发送私人消息给特定的用户,当我发送消息所有用户得到它时,我试图取消用户以获取消息,而我正在使用“如果”但它不工作任何想法。监听器onMessage JAVA
else if (tempM[2].equals(chat)) {
//send message to every one
if (userNameListErea.isSelectionEmpty()) {
chatTextErea.append(tempM[0] + ": " + tempM[1] + "\n");
// not send message to your self.
} else if (userNameListErea.getSelectedValue().toString().equals(userName)) {
chatTextErea.append("Can not sent private to your self \n");
// if its not public and not to ypurself the its private
}else {
chatTextErea.append(userNameListErea.getSelectedValue() + " send u private: " +
tempM[1] + "\n");
}
}
也许我错过了正确的命令当你试图使用的确切SMAE机制将消息发送到每一个人,一个sepecific用户从视图阻止用户的消息
工作!!!!!!!! – cfircoo