Browse Source

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

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

17
src/main/java/ChatGUI.java

@ -14,7 +14,10 @@ import javax.swing.JTextArea;
import javax.swing.JTextField; import javax.swing.JTextField;
public class ChatGUI implements ActionListener { 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 exit = new JMenuItem("Exit");
JMenuItem black = new JMenuItem("black"); JMenuItem black = new JMenuItem("black");
JMenuItem red = new JMenuItem("red"); JMenuItem red = new JMenuItem("red");
@ -39,17 +42,23 @@ public class ChatGUI implements ActionListener {
JMenu options = new JMenu("options"); JMenu options = new JMenu("options");
JMenu colors = new JMenu("font-colors"); JMenu colors = new JMenu("font-colors");
JMenu size = new JMenu("font-size");
JMenu menu = new JMenu("File"); JMenu menu = new JMenu("File");
menu.add(exit); menu.add(exit);
menu.add(options); menu.add(options);
bar.add(menu); bar.add(menu);
options.add(colors); options.add(colors);
options.add(size);
colors.add(black); colors.add(black);
colors.add(red); colors.add(red);
colors.add(blue); colors.add(blue);
colors.add(green); colors.add(green);
size.add(small);
size.add(medium);
size.add(large);
red.addActionListener(this); red.addActionListener(this);
blue.addActionListener(this); blue.addActionListener(this);
@ -95,15 +104,13 @@ public class ChatGUI implements ActionListener {
} }
if (e.getSource() == red) { if (e.getSource() == red) {
outputTextArea.setForeground(Color.RED); outputTextArea.setForeground(Color.RED);
}
if (e.getSource() == blue) {
} else if (e.getSource() == blue) {
outputTextArea.setForeground(Color.BLUE); outputTextArea.setForeground(Color.BLUE);
} else if (e.getSource() == black) { } else if (e.getSource() == black) {
outputTextArea.setForeground(Color.BLACK); outputTextArea.setForeground(Color.BLACK);
} else if (e.getSource() == green) { } else if (e.getSource() == green) {
outputTextArea.setForeground(Color.GREEN); outputTextArea.setForeground(Color.GREEN);
} }
} }
} }
Loading…
Cancel
Save