@@ -0,0 +1,2252 @@
+import java.awt.*;%0Aimport java.awt.event.*;%0Aimport java.io.*;%0Aimport java.net.*;%0A/**%0A * @author IndraDhanush%0A %0A */%0Apublic class Server extends Frame implements ActionListener,Runnable%0A%7B%0A //Declarations%0A Button b1;%0A TextField tf;%0A TextArea ta;%0A ServerSocket ss;%0A Socket s;%0A PrintWriter pw;%0A BufferedReader br;%0A Thread th;%0A %0A public Server()%0A %7B%0A  Frame f=new Frame(%22Server%22);//Frame for Server%0A  f.setLayout(new FlowLayout());//set layout%0A  f.setBackground(Color.orange);//set background color of the Frame%0A  b1=new Button(%22Send%22);//Send Button%0A  b1.setBackground(Color.green);%0A  b1.addActionListener(this);//Add action listener to send button.%0A  tf=new TextField(15);%0A  ta=new TextArea(50,20);%0A  ta.setBackground(Color.white);%0A  f.addWindowListener(new W1());//add Window Listener to the Frame%0A  f.add(tf);//Add TextField to the frame%0A  f.add(b1);//Add send Button to the frame%0A  f.add(ta);//Add TextArea to the frame%0A  try%7B%0A   ss=new ServerSocket(12000);//Socket for server%0A   s=ss.accept();//accepts request from client%0A   %0A   //below line reads input from InputStreamReader%0A   br=new BufferedReader(new InputStreamReader(s.getInputStream()));%0A   //below line writes output to OutPutStream%0A   pw=new PrintWriter(s.getOutputStream(),true);%0A  %7Dcatch(Exception e)%0A  %7B%0A  %7D%0A  th=new Thread(this);//start a new thread%0A  //th.setDaemon(true);//set the thread as demon%0A  th.start();%0A  setFont(new Font(%22Courier%22,Font.BOLD,20));%0A  f.setSize(300,300);//set the size%0A  f.setLocation(300,300);//set the location%0A  f.setVisible(true);%0A  f.validate();%0A %7D%0A %0A private class W1 extends WindowAdapter%0A %7B%0A  public void windowClosing(WindowEvent we) %0A  %7B%0A   System.exit(0);%0A  %7D%0A %7D%0A //This method will called after clicking on Send button.%0A public void actionPerformed(ActionEvent ae)%0A %7B%0A  pw.println(tf.getText());//write the value of textfield into PrintWriter%0A  tf.setText(%22%22);//clean the textfield%0A %7D%0A //Thread running as a process in background%0A public void run()%0A %7B%0A  while(true)%0A  %7B%0A   try%7B%0A    String s=br.readLine();//reads the input from textfield%0A    ta.append(s+%22%5Cn%22);//Append to TextArea%0A   %7Dcatch(Exception e)%0A   %7B%0A   %7D%0A  %7D %0A %7D%0A //Main method%0A public static void main(String args%5B%5D) %0A %7B%0A  //Instantiate AppServer class%0A  Server server = new Server();%0A %7D%0A%7D %0A%0A

Create Server.java