在Java语 言中,把组件放在BorderLayout的()区域时,它会自动垂直调整大小,但不是水平调整。
第1题:
A.DirectionDirection=EAST;
B.Directiondirection=Direction.WEST;
C.inta-Direction.NORTH;
D.Directiondirection=2;
第2题:
importjava.awt.*;publicclassXextendsFrame{publicstaticvoidmain(Stringargs){Xx=newX();x.pack();x.setVisible(true);}publicX(){setLayout(newBordrLayout());Panelp=newPanel();add(p,BorderLayout.NORTH);Buttonb=newButton(North”);p.add(b):Buttonb=newButton(South”);add(b1,BorderLayout.SOUTH):}}Whichtwostatementsaretrue?()
A.Thebuttonslabeled“North”and“South”willhavethesamewidth.
B.Thebuttonslabeled“North”and“South”willhavethesameheight.
C.Theheightofthebuttonlabeled“North”canveryiftheFrameisresized.
D.Theheightofthebuttonlabeled“South”canveryiftheFrameisresized.
E.Thewidthofthebuttonlabeled“North”isconstanteveniftheFrameisresized.
F.Thewidthofthebuttonlabeled“South”isconstanteveniftheFrameisresized.
第3题:
A.North或South
B.East或West
C.Center
D.North,South或Center
E.任何区域
第4题:
The general circulation of the surface water in Mediterranean is ______.
A.counter-clockwise
B.clockwise
C.from east to west
D.from north to south
第5题:
下列程序在Frame中设定BorderLayout布局管理器,选择正确的语句填入程序的横线处。 import java.awt.*; public class ex43 extends Frame { public static void main(String[] args) { ex43 bj = new ex43("BorderLayout"); ______ obj.add("North", new Button("North")); obj.add("South", new Button("Sourth")); obj.add("East", new Button ("East")); obj.add("West", new Button ("West")); obj. add ("Center", new Button ( "Center" ) ); obj.pack(); obj. setVisible (true); } public ex43(String str) { super (str); } }
A.obj.setLayout(new BorderLayout());
B.setLayout(new Borderkayout());
C.setLayout(BorderLayout());
D.obj.setLayout(BorderLayout());
第6题:
A.Directiond=NORTH;
B.Nav.Directiond=NORTH;
C.Directiond=Direction.NORTH;
D.Nav.Directiond=Nav.Direction.NORTH;
第7题:
请将下列程序的空白处补充完整。
Importjava.awt.*;
PublicclassEll_4
{
Publicstaticvoidmain(Stringargs[])
{
Framef=newFrame(“BorderLayout”);
fiadd(“North”,newbuRon(“North”));
f.add(“East”,newbutton(“East”));
f.add(“West”,newbutton(“West”));
f.add(“South”,tf);
f.setSize(200,200)
fipack();
fisetVisible(true);
}
}
第8题:
本题中,主窗口有一个按钮、一个文本域和一个复选按钮,初始时窗口的大小是不能调整的,选中复选按钮后,窗口大小就可以进行调整,如果撤销复选按钮的选择,则窗口的大小又不能调整,单击按钮可以关闭程序。 import java.awt.*; import java.awt.event.*; class MyFrame. extends Frame {Checkbox box; TextArea text; Button button; MyFrame(String s) {super(s); box=new Checkbox("设置窗口是否可调整大 小"); text=new TextArea(12,12); button=new Button("关闭窗口"); button.addActionListener(this); box.addltemListener(this); setBounds(100,100,200,300); setVisible(true); add(text,BorderLayout.CENTER); add(box.BorderLayout.SOUTH); add(button.BorderLayout.NORTH); ; validate; } public void itemStateChanged(ItemEVent e) {if(box.getState= =true) {setResizable(true); } else { setResizable(false); } } public void actionPerformed(ActionEvent e) {dispose; } } class java2 {public static void main(String args[]) { new MyFrame("java2"); } }
第9题:
使用______位置参数,能够使一个部件位于容器的右边。
A.BorderLayout.RIGHT
B.BorderLayout.WEST
C.BonierLayout.EAST
D.BorderLayout.NORTH
第10题:
The surface currents of the South Atlantic,South Pacific and South Indian Ocean follow,in general,a regular pattern of ______.
A.counter-clockwise circulation
B.clockwise circulation
C.trend from east to west
D.trend from north to south