From 6d32cd126c5df9b2ca9d4b3047a93516cb55eb48 Mon Sep 17 00:00:00 2001 From: Alena Bandarovich Date: Sat, 3 Feb 2024 21:11:38 +0100 Subject: [PATCH] Change position of input and output areas --- src/main/java/ChatClient.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index 00600d0..6380f66 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -1,4 +1,5 @@ import javax.swing.*; +import java.awt.*; import java.io.IOException; import java.net.Socket; @@ -23,10 +24,13 @@ public class ChatClient extends JFrame { private void initGui() { outputTextArea = new JTextArea(); + outputTextArea.setBorder(BorderFactory.createTitledBorder("Chat")); + inputTextField = new JTextField(); + inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben")); - add(outputTextArea); - add(inputTextField); + add(outputTextArea, BorderLayout.CENTER); + add(inputTextField, BorderLayout.SOUTH); setVisible(true); setSize(800, 600);