fix Problem with StringBuilder in ClientMessageList

This commit is contained in:
schrom01 2022-04-12 08:59:53 +02:00
parent eb0e6d0dbc
commit b246c3c7e3
2 changed files with 2 additions and 2 deletions

View File

@ -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<WindowEvent> {

View File

@ -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))