Code example for PrintWriter

Methods: flush, print

0
	     */ 
	public void send(String s) throws IOException
	{ 
		comm.append(s);
		comm.append("\n");
		out.print(s.replaceAll("\n", "\r\n"));
		out.print("\r\n");
		out.flush();
	} 
 
	/** 
	 * Receives a string from the socket and displays it in the comm text area. 
	 */ 
	public void receive() throws IOException 
	{ 
		String line = in.nextLine();
		comm.append(line);
		comm.append("\n");
	} 
 
	 /**