单选题A Button is positioned in a Frame. Only height of the Button is affected by the Frame while the width is not. Which layout manager should be used?()A  FlowLayoutB  CardLayoutC  North and South of BorderLayoutD  East and West of BorderLayoutE  GridLayou

题目
单选题
A Button is positioned in a Frame. Only height of the Button is affected by the Frame while the width is not. Which layout manager should be used?()
A

 FlowLayout

B

 CardLayout

C

 North and South of BorderLayout

D

 East and West of BorderLayout

E

 GridLayout

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

下列程序用GridLayout布局管理器将Frame分为1行3列,并放入Button构件,横线处应填入的语句是( )。 import java.awt.*; public class Test { public static void main (String[] args) { Frame. frm=new Frame. ("GridLayout"); ____________ frm.add (new Button("Button1")); frm.add (new Button("Button2")); frm.add (new Button("Button3")); frm.setSize (300,300); frm.setVisible (true); } }

A.frm.setLayout (GridLayout (1,3));

B.setLayout (new GridLayout(1,3));

C.frm.setLayout (new GridLayout(3,1));

D.frm.setLayout (new GridLayout(1,3));


正确答案:D
解析:GridLayout的构造方法参数第一个指出行数,第二个指出列数,由于容器是Frame的对象frm,因此需要用frm调用setLayout (newGridLayout (1,3))方法。

第2题:

下列程序采用BorderLayout布局管理,选择正确的语句填入横线处,实现在North区域显示一个名字为“北方”的Button构件。 import java.awt.*; public class ex48 { public static void main(String[] args) { frame. frm = new Frame. ("北方"); frm.setLayout(new BorderLayout()); frm.setSize(200, 200); frm.setVisible(true); } }

A.add("Nouth", new Button("北方"));

B.frm.add("South", new Button("北方"));

C.frm.add("Nouth", new Button("北方"));

D.Frm.add("South", Button("北方"));


正确答案:C

第3题:

public class X extends Frame{public static void main(String[] args){X x=new X();x.pack();x.setVisible(true);}public X(){setLayout(new GridLayout(2,2));Panel p1=new Panel(); add(p1);Button b1

A.all change height and width

B.Button One change height

C.Button Two change height and Button Three change width

D.Button Four change height and width


参考答案:D

第4题:

In the Northern Hemisphere, if the center of a high pressure area is due west of you, what wind direction would you expect?______.

A.South to west

B.South to east

C.North to west

D.North to east


正确答案:C
在北半球,如果高压中心在你的西部,你预料到是什么风向?西北风。

第5题:

The buoy symbol printed on your chart is leaning to the northeast. This indicates ______.

A.you should stay to the north or east of the buoy

B.you should stay to the west or south of the buoy

C.the buoy is a major lighted buoy

D.nothing special for navigational purposes


正确答案:D

第6题:

下列程序在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());


正确答案:A

第7题:

下列各种布局管理器中,Frame类的默认布局是()

A. FlowLayout

B. CardLayout

C. BorderLayout

D. GridLayout


正确答案:C

第8题:

定义枚举如下:publicenumDirection{EAST,SOUTH,WEST,NORTH}下列正确使用该枚举类型的语句是哪项?()

A.DirectionDirection=EAST;

B.Directiondirection=Direction.WEST;

C.inta-Direction.NORTH;

D.Directiondirection=2;


参考答案:B

第9题:

If the center of low pressure is due west of you in the Northern Hemisphere, which wind direction should you expect?

A.South to west

B.South to east

C.West to north

D.North to east


正确答案:B
在北半球一个低压正在拟的西部,风向应该怎样判别?东南。

第10题:

Tasmania is an island which lies()of the Australian mainland.

  • A、north of the northeastern corner
  • B、south of the southeastern corner
  • C、east of the northeastern comer
  • D、west of the southeastern corner

正确答案:B

更多相关问题