Browse Source

Optionspunkte Schriftgröße hinzugefügt(noch keine Funktion)

remotes/origin/server
Paul Kattenborn 11 months ago
parent
commit
b2083f814d
  1. 15
      src/main/java/ChatGUI.java

15
src/main/java/ChatGUI.java

@ -15,6 +15,9 @@ 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,18 +42,24 @@ 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);
black.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);
}
}
}
Loading…
Cancel
Save