Browse Source

Schriftgrößenwahl implementiert

remotes/origin/server
Paul Kattenborn 11 months ago
parent
commit
24c7f1d6ab
  1. 16
      src/main/java/ChatGUI.java

16
src/main/java/ChatGUI.java

@ -1,6 +1,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -64,6 +65,9 @@ public class ChatGUI implements ActionListener {
blue.addActionListener(this);
black.addActionListener(this);
green.addActionListener(this);
small.addActionListener(this);
medium.addActionListener(this);
large.addActionListener(this);
exit.addActionListener(this);
@ -112,5 +116,17 @@ public class ChatGUI implements ActionListener {
} else if (e.getSource() == green) {
outputTextArea.setForeground(Color.GREEN);
}
if(e.getSource() == small) {
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 12));
}
if(e.getSource() == medium) {
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 16));
}
if(e.getSource() == large) {
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 20));
}
}
}
Loading…
Cancel
Save