该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
import java.awt.*;
public class ButtonGrid extends Frame {
public ButtonGrid() {
Button B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B12,B13,B14,B15,B16,B17,B18,B19,B20;
B1=new Button("Num Lock");
B2=new Button("/");
B3=new Button("*");
B4=new Button("-");
B5=new Button("7");
B6=new Button("8");
B7=new Button("9");
B8=new Button("+");
B9=new Button("4");
B10=new Button("5");
B11=new Button("6");
B12=new Button();
B13=new Button("1");
B14=new Button("2");
B15=new Button("3");
B16=new Button("Enter");
B17=new Button("0");
B18=new Button();
B19=new Button("Del");
B20=new Button();
setLayout(new GridLayout(5,4));
this.add(B1);
this.add(B2);
this.add(B3);
this.add(B4);
this.add(B5);
this.add(B6);
this.add(B7);
this.add(B8);
this.add(B9);
this.add(B10);
this.add(B11);
this.add(B12);
this.add(B13);
this.add(B14);
this.add(B15);
this.add(B16);
this.add(B17);
this.add(B18);
this.add(B19);
this.add(B20);
this.setSize(500,400);
this.setVisible(true);
}
public static void main(String[] args)
{
ButtonGrid f=new ButtonGrid();
}
}