From b2083f814d47495f3dd0da725f60b4235ed3b413 Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Fri, 9 Feb 2024 02:11:04 +0100 Subject: [PATCH] =?UTF-8?q?Optionspunkte=20Schriftgr=C3=B6=C3=9Fe=20hinzug?= =?UTF-8?q?ef=C3=BCgt(noch=20keine=20Funktion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ChatGUI.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/ChatGUI.java b/src/main/java/ChatGUI.java index b33e153..a63cbcc 100644 --- a/src/main/java/ChatGUI.java +++ b/src/main/java/ChatGUI.java @@ -14,7 +14,10 @@ import javax.swing.JTextArea; import javax.swing.JTextField; public class ChatGUI implements ActionListener { - + + JMenuItem small = new JMenuItem("small-font"); + JMenuItem medium = new JMenuItem("medium-font"); + JMenuItem large = new JMenuItem("large-font"); JMenuItem exit = new JMenuItem("Exit"); JMenuItem black = new JMenuItem("black"); JMenuItem red = new JMenuItem("red"); @@ -39,17 +42,23 @@ public class ChatGUI implements ActionListener { JMenu options = new JMenu("options"); JMenu colors = new JMenu("font-colors"); + JMenu size = new JMenu("font-size"); JMenu menu = new JMenu("File"); menu.add(exit); menu.add(options); bar.add(menu); options.add(colors); + options.add(size); colors.add(black); colors.add(red); colors.add(blue); colors.add(green); + + size.add(small); + size.add(medium); + size.add(large); red.addActionListener(this); blue.addActionListener(this); @@ -95,15 +104,13 @@ public class ChatGUI implements ActionListener { } if (e.getSource() == red) { outputTextArea.setForeground(Color.RED); - } - if (e.getSource() == blue) { + + } else if (e.getSource() == blue) { outputTextArea.setForeground(Color.BLUE); } else if (e.getSource() == black) { outputTextArea.setForeground(Color.BLACK); } else if (e.getSource() == green) { outputTextArea.setForeground(Color.GREEN); - } - } }