diff --git a/client/src/main/java/ch/zhaw/pm2/multichat/client/ChatWindowController.java b/client/src/main/java/ch/zhaw/pm2/multichat/client/ChatWindowController.java index 51bc48f..f73e498 100644 --- a/client/src/main/java/ch/zhaw/pm2/multichat/client/ChatWindowController.java +++ b/client/src/main/java/ch/zhaw/pm2/multichat/client/ChatWindowController.java @@ -189,7 +189,7 @@ public class ChatWindowController { private void redrawMessageList() { this.messageArea.clear(); - Platform.runLater(() -> this.messageArea.appendText(messages.getFilteredMessages(filterValue.getText().strip()))); + Platform.runLater(() -> this.messageArea.setText(messages.getFilteredMessages(filterValue.getText().strip()))); } class WindowCloseHandler implements EventHandler { diff --git a/client/src/main/java/ch/zhaw/pm2/multichat/client/ClientMessageList.java b/client/src/main/java/ch/zhaw/pm2/multichat/client/ClientMessageList.java index 402d19d..a811406 100644 --- a/client/src/main/java/ch/zhaw/pm2/multichat/client/ClientMessageList.java +++ b/client/src/main/java/ch/zhaw/pm2/multichat/client/ClientMessageList.java @@ -12,7 +12,7 @@ public class ClientMessageList { } public String getFilteredMessages(String filter) { - StringBuilder result = null; + StringBuilder result = new StringBuilder(); boolean showAll = filter == null || filter.isBlank(); for(Message message : messages) { if(showAll || message.matchesFilter(filter))