July 2017
Intermediate to advanced
466 pages
11h 24m
English
Now that we can see the conversations that we've been having, we need to add the ability to take part in those conversations--to send new text messages. We'll start on the client. We've actually already seen the handler for the New Message button assigned. It is as follows:
newMessageBtn.setOnAction(event -> sendNewMessage());
What we need to do now is to look at this sendNewMessage() method itself:
private void sendNewMessage() { Optional<String> result = SendMessageDialogController .showAndWait(conversation.get()); if (result.isPresent()) { Conversation conv = conversation.get(); Message message = new Message(); message.setThreadId(conv.getThreadId()); message.setAddress(conv.getParticipant()); message.setBody(result.get()); ...Read now
Unlock full access