Browse Source

Pop-Up Button hinzugefügt

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

14
src/main/java/ChatGUI.java

@ -11,6 +11,7 @@ import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@ -30,6 +31,8 @@ public class ChatGUI implements ActionListener {
JMenuItem green = new JMenuItem("green");
JMenuItem exit = new JMenuItem("Exit");
private JButton popupButton;
JTextField inputTextField = new JTextField();
JTextArea outputTextArea = new JTextArea();
@ -53,6 +56,8 @@ public class ChatGUI implements ActionListener {
JMenu options = new JMenu("options");
JMenu colors = new JMenu("font-colors");
JMenu size = new JMenu("font-size");
popupButton = new JButton("Popup-Nachricht senden");
JMenu menu = new JMenu("File");
menu.add(exit);
@ -89,8 +94,9 @@ public class ChatGUI implements ActionListener {
// Set up the input panel with text field and send button
JPanel inputPanel = new JPanel(new BorderLayout());
inputPanel.add(popupButton, BorderLayout.EAST);
inputPanel.add(inputTextField, BorderLayout.CENTER);
inputPanel.add(sendButton, BorderLayout.EAST);
inputPanel.add(sendButton, BorderLayout.WEST);
gui.add(inputPanel, BorderLayout.SOUTH);
inputTextField.addActionListener(this);
@ -141,4 +147,10 @@ public class ChatGUI implements ActionListener {
}
}
public class NotificationManager {
public void sendPopupMessage(String message) {
JOptionPane.showMessageDialog(gui, message);
}
}
}
Loading…
Cancel
Save