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