title: Get text from text field and pass into string using BufferedReader object
body: <p>How to get text from text field and pass into string using <code>BufferedReader</code> object?</p>
  
  <p>I want to get text from text field and want to pass it into string using buffer reader object, and then print that particular text in the text area, and then pass that text using <code>PrintWriter</code> object to socket...</p>
  
  <p>My code..</p>
  
  <pre><code>else if(ae.getSource()==btnsend)
          {
           try   
           {
               PrintWriter pw=new PrintWriter(socket.getOutputStream(), true);
               BufferedReader brk=new BufferedReader(new InputStreamReader(System.in));
               BufferedReader brs=new BufferedReader(new InputStreamReader(socket.getInputStream()));
               String str="";
              while(true)
              {
              // m confused after this..how to proceed..
              jtxts3.getText();
              str=brk.toString();
              jareas1.setText(str);
              pw.println();
              str=brs.toString();
              jareas1.setText("Client Says :-"+str);
              }
          }
            catch(Exception ex)
          {
              System.out.println("Exception caught : "+ex);
          }
  </code></pre>