-->
当前位置:首页 > 题库

单选题:What most closely matches the appearance when this code runs?

Luz5年前 (2021-05-10)题库1032
What most closely matches the appearance when this code runs? @[B](2)
```Java
public class CompLay extends Frame{
public static void main(String argv[]){
CompLay cl = new CompLay();
}

CompLay(){
Panel p = new Panel();
p.setBackground(Color.pink);
p.add(new Button("One"));
p.add(new Button("Two"));
p.add(new Button("Three"));
add("South",p);
setLayout(new FlowLayout());
setSize(300,300);
setVisible(true);
}
}
```
A. The buttons will run from left to right along the bottom of the Frame
B. The buttons will run from left to right along the top of the frame
C. The buttons will not be displayed
D. Only button three will show occupying all of the frame



A.The buttons will run from left to right along the bottom of the Frame
B.The buttons will run from left to right along the top of the frame
C.The buttons will not be displayed
D.Only button three will show occupying all of the frame


答案:B