for循环的使用
[bo] 1 2 3 +4 5 6 -
7 8 9 *
0 / . =
用FOR循环实现按钮的创建(顺序)[/bo]
2008-11-13 01:21
程序代码: public JButton[] createButtons(){
String[] label = {"1","2","3","+","4","5","6","-","7","8","9","*","0","/",".","="};
JButton[] buttons = new JButton[16];
for(int i=0;i<label.length;i++){
buttons[i] = new JButton(label[i]);
}
return buttons;
}
2008-11-13 10:04
2008-11-14 17:41