JAVA题库:格林模拟试题二(上)3
来源:优易学  2010-1-15 11:36:11   【优易学:中国教育考试门户网】   资料下载   IT书店

Question 13)
How do you indicate where a component will be positioned using Flowlayout?
1) North, South,East,West
2) Assign a row/column grid reference
3) Pass a X/Y percentage parameter to the add method
4) Do nothing, the FlowLayout will position the component

Question 14)
How do you change the current layout manager for a container
1) Use the setLayout method
2) Once created you cannot change the current layout manager of a component
3) Use the setLayoutManager method
4) Use the updateLayout method

Question 15)
Which of the following are fields of the GridBagConstraints class?
1) ipadx
2) fill
3) insets
4) width

Question 16)
What most closely matches the appearance when this code runs?
import java.awt.*;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);    }}
1) The buttons will run from left to right along the bottom of the Frame
2) The buttons will run from left to right along the top of the frame
3) The buttons will not be displayed
4) Only button three will show occupying all of the frame

[1] [2] 下一页

责任编辑:cyth

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训