|
|
@ -34,7 +34,7 @@ public class ChatGUI implements ActionListener { |
|
|
|
|
|
|
|
JMenuItem exit = new JMenuItem("Exit"); |
|
|
|
|
|
|
|
private JButton popupButton; |
|
|
|
JButton popupButton; |
|
|
|
|
|
|
|
JTextField inputTextField = new JTextField(); |
|
|
|
JTextArea outputTextArea = new JTextArea(); |
|
|
@ -59,7 +59,9 @@ public class ChatGUI implements ActionListener { |
|
|
|
JMenu colors = new JMenu("font-colors"); |
|
|
|
JMenu size = new JMenu("font-size"); |
|
|
|
|
|
|
|
// Create Pop-Up Button |
|
|
|
popupButton = new JButton("Popup-Nachricht senden"); |
|
|
|
popupButton.addActionListener(this); |
|
|
|
|
|
|
|
JMenu menu = new JMenu("File"); |
|
|
|
menu.add(exit); |
|
|
@ -155,15 +157,16 @@ public class ChatGUI implements ActionListener { |
|
|
|
if (e.getSource() == large) { |
|
|
|
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) { |
|
|
|
JOptionPane.showMessageDialog(gui, message); |
|
|
|
} |
|
|
|
|
|
|
|
public void sendPopupMessage(String message) { |
|
|
|
JOptionPane.showMessageDialog(gui, message); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |