import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class M_serverApp extends javax.swing.JFrame implements Runnable { ServerSocket server = null; Socket client = null; DataInputStream dis = null; DataOutputStream dos = null; String m = null; /** * Creates new form M_serverApp */ public M_serverApp() { initComponents(); } public void run() { ClientHandler handler = new ClientHandler(); handler.start(); } class ClientHandler extends Thread{ public ClientHandler(){ /******************/ try { server = new ServerSocket(1254); System.out.println("start"); }catch(IOException e ){ System.out.println(e.getMessage()); System.out.println(e.getStackTrace()); } while (true){ try{ client = server.accept(); // System.out.println("2"); dos = new DataOutputStream(client.getOutputStream()); dis = new DataInputStream(client.getInputStream()); m = dis.readUTF(); System.out.println(m + "***"+client.getInetAddress()); txt2.setEditable(false); txt2.setText(m.toString());/***********Here jTextField I Want To Chage*********/ }catch(IOException e ){ System.out.print("Error code"); } } /********************/ } }