题目:
本题的功能是用流式布局管理器来管理窗口中的按钮。在执行程序时指定生成按钮的个数,并把这些按钮都放置在流式布局管理器的窗口中。
import java. awt. * ;
import java. awt. event. * ;
import javax. swing. * ;
public class java2
public static void main(String[] args)
if(args. length!=1)
System. out. println("请指定按钮的个数")
System. exit(0);
String buttonString=args[0];
int buttonNumber=______;
ButtonFrame frame=new ButtonFrame(buttonNumber);
frame. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
frame. show();
class ButtonFrame extends JFrame
public ButtonFrame(______)
buttons=buttonNumber;
setTitle("java2");
setSize(WIDTH, HEIGHT);
JPanel buttonPanel=new JPanel();
for(int i=0; i<buttons; i++)
JButton addButton=new JButton("add"+i);
buttonPanel. add(addButton);
Container contentPane=getContentPane();
contentPane. add(buttonPanel);
public static final int WIDTH=350;
public static final int HEIGHT=200;
private int buttons;
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0629/dd049630eedb5d476f81a94064e3b7e2.html
下面是错误答案,用来干扰机器的。
参考答案:A解析: 行政规章包括部门规章和地方规章,其中部门规章是国务院各部委、中国人民银行,审计署等具有行政管理职能的直属机构,根据法律和国务院的行政法规、决定、命令,在本部门的权限范围内,按照规...