📄 chesspcname.java
字号:
import java.awt.*;
import chessArray;
import java .awt.event .* ;
public class chessPcName extends Dialog implements ActionListener
{
TextField td=new TextField ("",30);
Label lb=new Label ("请输入庄家电脑名称:");
Button bt=new Button ("确定");
public chessPcName(Frame frbak)
{
super(frbak,"获取庄家名称",true);
setBackground(Color.cyan);
int width=200;
int height=200;
this.add("North",lb);
this.add("Center",td);
bt.addActionListener (this);
this.add("South",bt);
setFont(new Font("chequer",Font.BOLD,16));
setBounds(chessArray.offsize.width/2-width/2,chessArray.offsize.height/2-height/2,width,height);
show();
}
public void actionPerformed(ActionEvent e)
{
chessClient chCe= new chessClient (td.getText ());
chessArray.information("您是挑战者,不能先走棋");
chessArray.readyIn=true;//挑战者只能先接受数据
chessArray.change =false;//挑战者不允许先走棋
chCe.start ();
this.dispose ();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -