?? chesspcname.java
字號(hào):
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 ("請(qǐng)輸入莊家電腦名稱:");
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("您是挑戰(zhàn)者,不能先走棋");
chessArray.readyIn=true;//挑戰(zhàn)者只能先接受數(shù)據(jù)
chessArray.change =false;//挑戰(zhàn)者不允許先走棋
chCe.start ();
this.dispose ();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -