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); - } - } }