From 6d9cb97cba88ba86b40bbfc35dd4950b65ad049d Mon Sep 17 00:00:00 2001 From: Alena Bandarovich Date: Wed, 7 Feb 2024 19:15:56 +0100 Subject: [PATCH] Add auto scroll to end --- src/main/java/ChatClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index 44a0bc6..2c043b5 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -56,6 +56,7 @@ public class ChatClient extends JFrame implements KeyListener { while (true) { String message = fromServerReader.readLine(); outputTextArea.append(message + "\n"); + outputScrollPane.getVerticalScrollBar().setValue(outputScrollPane.getVerticalScrollBar().getMaximum()); } } catch (IOException e) { JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen.");