博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SOCKET
阅读量:4349 次
发布时间:2019-06-07

本文共 1092 字,大约阅读时间需要 3 分钟。

       
f.setLayout(new BorderLayout());        listenButton=new JButton("连接端口8600");        f.add(listenButton, BorderLayout.NORTH);        sessionTextArea=new JTextArea();        f.add(sessionTextArea, BorderLayout.CENTER);                jLabel=new JLabel("发送:");        sendTextField=new  JTextField(20);        sendButton=new JButton("发送消息");        pl=new JPanel();        pl.setLayout(new FlowLayout());        pl.add(jLabel);        pl.add(sendTextField);        pl.add(sendButton);        f.add(pl, BorderLayout.SOUTH);        setTitle("客户端");        setSize(500,300);        setVisible(true);        listenButton.addActionListener(this);        sendButton.addActionListener(this);

     

 

  jLabel=new JLabel("发送:"); 

        sendTextField=new  JTextField(20); 
        sendButton=new JButton("发送消息");
        pl=new JPanel();
        pl.setLayout(new FlowLayout());
        pl.add(jLabel);
        pl.add(sendTextField);
        pl.add(sendButton);
        f.add(pl, BorderLayout.SOUTH);
        setTitle("客户端");
        setSize(500,300);
        setVisible(true);
        listenButton.addActionListener(this);
        sendButton.addActionListener(this);

转载于:https://www.cnblogs.com/sunxiang/p/4250039.html

你可能感兴趣的文章