Browse Source

Popup-Button Funktionalität

remotes/origin/server
Paul Kattenborn 11 months ago
parent
commit
13f1288977
  1. 8
      src/main/java/ChatGUI.java

8
src/main/java/ChatGUI.java

@ -60,6 +60,7 @@ public class ChatGUI implements ActionListener {
JMenu size = new JMenu("font-size"); JMenu size = new JMenu("font-size");
popupButton = new JButton("Popup-Nachricht senden"); popupButton = new JButton("Popup-Nachricht senden");
popupButton.addActionListener(this);
JMenu menu = new JMenu("File"); JMenu menu = new JMenu("File");
menu.add(exit); menu.add(exit);
@ -155,10 +156,14 @@ public class ChatGUI implements ActionListener {
if (e.getSource() == large) { if (e.getSource() == large) {
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 20)); outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 20));
} }
if (e.getSource() == popupButton) {
String message = inputTextField.getText();
inputTextField.setText("");
sendPopupMessage(message);
}
} }
public class NotificationManager {
public void sendPopupMessage(String message) { public void sendPopupMessage(String message) {
JOptionPane.showMessageDialog(gui, message); JOptionPane.showMessageDialog(gui, message);
@ -166,4 +171,3 @@ public class ChatGUI implements ActionListener {
} }
}
Loading…
Cancel
Save