/** */ /** * 我的聊天程序,主程序! */ package chatsocket; import javax.swing.UIManager; import mychat. * ; import transSocket. * ; public class ChatMain ... { private ChatSocket socket; public ChatMain()...{ socket=new ChatSocket(); } public static void main(String[] args)...{ try...{ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e)...{ e.printStackTrace(); } MyChatFrame chat=new MyChatFrame(); ChatReceiveSocket receiveSocket=new ChatReceiveSocket(); TransServerSocket tra=new TransServerSocket(chat); tra.start(); while(true)...{ receiveSocket.run(); String st1=receiveSocket.getReceiveMessage(); String st2=chat.getArea1()+" "+st1; chat.setArea1(st2); } }}