From 3048bfdef80163ce08aeebc82c9cd8992c425337 Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Fri, 9 Feb 2024 01:46:50 +0100 Subject: [PATCH] =?UTF-8?q?menue-Bar=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ChatGUI.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/ChatGUI.java b/src/main/java/ChatGUI.java index 109f0f1..645f2c4 100644 --- a/src/main/java/ChatGUI.java +++ b/src/main/java/ChatGUI.java @@ -5,6 +5,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; @@ -25,6 +27,13 @@ public class ChatGUI implements ActionListener { gui.setLayout(new BorderLayout()); + JMenuBar bar = new JMenuBar(); + gui.setJMenuBar(bar); + + JMenu menu = new JMenu("File"); + + bar.add(menu); + // Set up the output text area with scrolling JScrollPane outputScrollPane = new JScrollPane(outputTextArea); gui.add(outputScrollPane, BorderLayout.CENTER);