⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connectp.java~7~

📁 用java实现的游戏例子(包括俄罗斯方块等),值得借鉴.
💻 JAVA~7~
字号:
package dialog;import java.awt.*;import java.awt.event.*;import TFrame;import client.*;/** * Title: * Description: * Copyright:    Copyright (c) 2001 * Company: * @author * @version 1.0 */public class ConnectP extends Panel {    Label label1 = new Label();    TextField textField1 = new TextField();    Button button1 = new Button();    TFrame m_tFrame;    Dialog d;    public ConnectP(Dialog tempD,TFrame tFrame)    {        super(d);        d=tempD;        m_tFrame=tFrame;        try {            jbInit();        }        catch(Exception e) {            e.printStackTrace();        }    }    private void jbInit() throws Exception {        label1.setText("要连接机器的IP或名字");        label1.setBounds(new Rectangle(22, 20, 137, 18));        this.setLayout(null);        textField1.setBounds(new Rectangle(169, 19, 83, 22));        button1.setLabel("确    定");        button1.setBounds(new Rectangle(101, 67, 75, 29));        button1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(ActionEvent e) {                button1_actionPerformed(e);            }        });        this.add(button1, null);        this.add(label1, null);        this.add(textField1, null);    }    void button1_actionPerformed(ActionEvent e) {        m_tFrame.m_client=new MyClient("sxf",m_tFrame);        System.out.println("连接对方");        m_tFrame.m_nNetStatus=TFrame.CLIENT;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -