@@ -0,0 +1,2387 @@
+package Chat_Server_4;%0A%0A%0Aimport java.awt.BorderLayout;%0Aimport java.awt.Color;%0Aimport java.awt.Container;%0Aimport java.awt.Graphics;%0Aimport java.awt.GridLayout;%0Aimport java.awt.TextField;%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0A%0Aimport javax.swing.JApplet;%0Aimport javax.swing.JButton;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.JScrollPane;%0Aimport javax.swing.JTextArea;%0Aimport javax.swing.JTextField;%0A%0Apublic class Chat_Server_Main extends JApplet implements ActionListener%7B%0A%0A%09TextField messageTextField = new TextField(%22Type your message%22);%0A%09JButton sendButton = new JButton(%22Send%22);%0A%09JButton disconnectButton = new JButton(%22Disconnect%22);%0A%09JButton privateButton = new JButton(%22Send Private Message%22);%0A%09JTextArea displayMessageArea = new JTextArea(); // set up JTextArea to display messages%0A%09JTextArea displayUserArea = new JTextArea();%0A%09JPanel centerPanel = new JPanel();%0A%09JPanel bottomPanel = new JPanel();%0A%09JPanel rightPanel = new JPanel();%0A%0A%09public Chat_Server_Main()%7B%0A%09%09%0A%09%7D%0A%09%0A%09public void init()%7B%0A%09%09%0A%09%09//Container container = getContentPane();%0A%09%09%0A%09%09add(bottomPanel, BorderLayout.SOUTH);%0A%09%09%0A%0A%09%09bottomPanel.add(disconnectButton);%0A%09%09disconnectButton.addActionListener(this);%0A%09%09%0A%09%09bottomPanel.add(privateButton);%0A%09%09privateButton.addActionListener(this);%0A%09%09%0A%09%09add(bottomPanel, BorderLayout.SOUTH);%0A%09%09bottomPanel.add(messageTextField);%0A%09%09this.setSize(20, 20);%0A%09%09%0A%09%09bottomPanel.add(sendButton);%0A%09%09sendButton.addActionListener(this);%0A%09%09%0A%09%09add(rightPanel, BorderLayout.CENTER);%0A%09%09rightPanel.setBackground(Color.WHITE);%0A%09%09rightPanel.add(displayUserArea);%0A%09%09displayUserArea.setEditable(false);%0A%09%09this.setSize(100, 100);%0A        %0A%09%09add(centerPanel, BorderLayout.CENTER);%0A%09%09centerPanel.setBackground(Color.WHITE);%0A%09%09centerPanel.add(displayMessageArea);%0A        displayMessageArea.setEditable(false);%0A      //  container.add(new JScrollPane(displayMessageArea), BorderLayout.NORTH );%0A    %09this.setSize(100, 100);%0A        %0A    %09%0A    %09setSize(710,400);%0A   %0A%09%7D%0A%0A%09@Override%0A%09public void actionPerformed(ActionEvent e) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09if(e.getActionCommand()==(%22Send%22)) %7B%0A%09%09%09String sentMessage = messageTextField.getText();%0A%09%09%09ChatServerThread.send(sentMessage);%0A%09%09%09displayMessageArea.append(sentMessage);%09%0A%09%09%7D%0A%09%09%0A%09%09if(e.getActionCommand()==(%22Disconnect%22)) %7B%0A%09%09%09%0A%09%09%7D%0A%09%09%0A%09%09if(e.getActionCommand()==(%22Send Private Message%22))%7B%0A%09%09%09%0A%09%09%7D%0A%09%7D%0A%09%0A%09%0A%7D%0A

Create Chat_Server_Main.java