java图形界面键盘布局_初学者,帮忙看一下JAVA写小键盘布局

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

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();

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值