From b23c506d775e72cf9e7aff4221fc649bc916404a Mon Sep 17 00:00:00 2001 From: delvh Date: Sat, 14 Mar 2020 17:04:51 +0100 Subject: [PATCH] fixed typo --- src/main/java/envoy/client/ui/ChatWindow.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index bfafc06..6a5ae38 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -46,7 +46,7 @@ public class ChatWindow extends JFrame { * * @since Envoy 0.1-beta */ - public static final int MAX_MESSEAGE_LENGTH = 200; + public static final int MAX_MESSAGE_LENGTH = 200; // User specific objects private Client client; @@ -575,8 +575,7 @@ public class ChatWindow extends JFrame { userListModel.addElement(user); // Check if user exists in local DB - if (localDb.getChats().stream().noneMatch(c -> c.getRecipient().getId() == user.getId())) - localDb.getChats().add(new Chat(user)); + if (localDb.getChats().stream().noneMatch(c -> c.getRecipient().getId() == user.getId())) localDb.getChats().add(new Chat(user)); }); SwingUtilities.invokeLater(() -> userList.setModel(userListModel)); @@ -587,15 +586,15 @@ public class ChatWindow extends JFrame { /** * Checks whether the length of the text inside messageEnterTextArea >= - * {@link ChatWindow#MAX_MESSEAGE_LENGTH} + * {@link ChatWindow#MAX_MESSAGE_LENGTH} * and splits the text into the allowed part, if that is the case. * * @since Envoy v0.1-beta */ private void checkMessageTextLength() { String input = messageEnterTextArea.getText(); - if (input.length() >= MAX_MESSEAGE_LENGTH) { - messageEnterTextArea.setText(input.substring(0, MAX_MESSEAGE_LENGTH - 1)); + if (input.length() >= MAX_MESSAGE_LENGTH) { + messageEnterTextArea.setText(input.substring(0, MAX_MESSAGE_LENGTH - 1)); // TODO: current notification is like being hit with a hammer, maybe it should // be replaced with a more subtle notification JOptionPane.showMessageDialog(messageEnterTextArea,