单选题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?()AFlowLayoutBCardLayoutCNorth and South of BorderLayoutDEast and West of BorderLayoutEGridLayout

题目
单选题
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


相似考题
参考答案和解析
正确答案: C
解析: 这个还是布局管理器的问题,流布局管理器(FlowLayout)将根据框架的大小随时调整它里面的组件的大小,包括高度和宽度,这个管理器不会约束组件的大小,而是允许他们获得自己的最佳大小,一行满了以后将在下一行放置组件;卡片管理器(CardLayout)一次显式一个加入的组件(根据加入时的关键字);网格管理器(GridLayout)将容器划分为固定的网格,容器大小的改变将影响所有组件的大小,每个组件的大小都会同等地变化;边界管理器(BorderLayout)将容器划分为五个区域,分为东南西北和中间,东西区域的宽度为该区域里面组件的最佳宽度,高度为容器的高度减去南北区域的高度,这是一个可能变化的值,而南北区域的宽度为容器的整个宽度,高度为组件的最佳高度,中间区域的高度为容器的高度减去南北区域的高度,宽度为容器的宽度减去东西区域的宽度。
更多“单选题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”相关问题
  • 第1题:

    下列程序采用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

  • 第2题:

    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

  • 第3题:

    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
    在北半球,如果高压中心在你的西部,你预料到是什么风向?西北风。

  • 第4题:

    class Parent {     String one, two;  public Parent(String a, String b){     one = a;     two = b;    }  public void print(){ System.out.println(one); }    }  public class Child extends Parent {     public Child(String a, String b){     super(a,b);     }  public void print(){  System.out.println(one + " to " + two);     }  public static void main(String arg[]){     Parent p = new Parent("south", "north");     Parent t = new Child("east", "west");     p.print();     t.print();     }     }  Which of the following is correct?()

    • A、 Cause error during compilation. 
    • B、 south         east 
    • C、 south to north     east to west    
    • D、 south to north      east    
    • E、 south     east to west

    正确答案:E

  • 第5题:

    JPanel默认的布局管理器是()

    • A、FlowLayout
    • B、CardLayout
    • C、BorderLayout
    • D、GridLayout

    正确答案:A

  • 第6题:

    import java.awt.*;   public class X extends Frame {   public static void main (String args) {   X x = new X();   x.pack();   x.setVisible(true);   }  public X() {   setLayout (new BordrLayout());   Panel p = new Panel ();   add(p, BorderLayout.NORTH);   Button b = new Button (“North”);   p.add(b):   Button b = new Button (“South”);   add(b1, BorderLayout.SOUTH):   }   }   Which two statements are true?()

    • A、 The buttons labeled “North” and “South” will have the same width.
    • B、 The buttons labeled “North” and “South” will have the same height.
    • C、 The height of the button labeled “North” can very if the Frame is resized.
    • D、 The height of the button labeled “South” can very if the Frame is resized.
    • E、 The width of the button labeled “North” is constant even if the Frame is resized.
    • F、 The width of the button labeled “South” is constant even if the Frame is resized.

    正确答案:B,E

  • 第7题:

    import java.awt*;   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= new Button (“One”);    P1.add(b1);   Panel p2 = new panel();    Add(p2);   Button b2= new Button (“Two”);    P2.add(b2);    Button b3= new Button (“Three”);   add(b3);   Button b4= new Button (“Four”);   add(b4);   )   )   Which two statements are true? ()

    • A、 All the buttons change height if the frame height is resized.
    • B、 All the buttons change width if the Frame width is resized.
    • C、 The size of the button labeled “One” is constant even if the Frame is resized.
    • D、 Both width and height of the button labeled “Three” might change if the Frame is resized.

    正确答案:C,D

  • 第8题:

    Which statement is true about mouse events? ()

    • A、The cursor style can be set to CAUTION. 
    • B、Double-clicking a mouse button can potentially fire six mouse event triggers. 
    • C、The values for the SYSTEM.MOUSE_BUTTON_PRESSED system variable can only be 1 or 2. 
    • D、Click and double-click button actions can only detect if the mouse is positioned in an item.

    正确答案:B

  • 第9题:

    单选题
    Which statement is true about mouse events? ()
    A

    The cursor style can be set to CAUTION. 

    B

    Double-clicking a mouse button can potentially fire six mouse event triggers. 

    C

    The values for the SYSTEM.MOUSE_BUTTON_PRESSED system variable can only be 1 or 2. 

    D

    Click and double-click button actions can only detect if the mouse is positioned in an item.


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    Which layout manager is used when the frame is resized the buttons’s position in the Frame might be changed?()
    A

     BorderLayout

    B

     FlowLayout

    C

     CardLayout

    D

     GridLayout


    正确答案: A
    解析: A:该布局管理器将容器划分为五个部分,容器大小的改变不会影响其中的组件的位置而是影响他们的大小。 
    B:该布局管理器根据放入其中的组件的最合适大小调整组件的位置,根据组件放入的顺序安排,一行不能容纳时放入下一行,因此容器的大小改变可能改变组件的位置。    
    C://该布局管理器显示放入该容器的当前页中的组件,一次显示一个,容器大小的改变不能影响其中组件的位置。 
    D://该布局管理器将容器划分为固定的网格,组件加入后占据一个单元,各组件的相对位置不会因为容器的大小变化而变化,改变的只是组件的大小。

  • 第11题:

    单选题
    When latitude and longitude are used,these shall be expressed in()(and decimals of a minute if necessary),north or south of the Equator and east or west of Greenwich.
    A

    Fathoms and meters

    B

    Miles and kilometers

    C

    Arc and degrees

    D

    Degrees and minutes


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    You need to ensure that the new sales manager is able to view clients within only the North and South regions. What should you do?()
    A

    Add a Denied member set for the West clients to NorthRole.

    B

    Add an Allowed member set for the South clients to NorthRole.

    C

    Create a new role for the sales manager and add a Denied member set for the South clients.

    D

    Create a new role for the sales manager and add an Allowed member set for the South clients. Remove the sales manager from SouthAndWestRole.


    正确答案: C
    解析: 暂无解析

  • 第13题:

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

    A. FlowLayout

    B. CardLayout

    C. BorderLayout

    D. GridLayout


    正确答案:C

  • 第14题:

    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
    在北半球一个低压正在拟的西部,风向应该怎样判别?东南。

  • 第15题:

    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

  • 第16题:

    Which layout manager is used when the frame is resized the buttons’s position in the Frame might be changed?()         

    • A、 BorderLayout
    • B、 FlowLayout
    • C、 CardLayout
    • D、 GridLayout

    正确答案:B

  • 第17题:

    New Zealand is situated about 1, 500 km ()

    • A、north-west of Australia
    • B、south-east of Australia
    • C、north-east of Australia
    • D、south-west of Australia

    正确答案:B

  • 第18题:

    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

    正确答案:D

  • 第19题:

    Which tool in the layout model could you use to create an external boiler plate object?()

    • A、Field 
    • B、Frame 
    • C、Button 
    • D、Rectangle
    • E、Link file

    正确答案:E

  • 第20题:

    You need to ensure that the new sales manager is able to view clients within only the North and South regions. What should you do?()

    • A、Add a Denied member set for the West clients to NorthRole.
    • B、Add an Allowed member set for the South clients to NorthRole.
    • C、Create a new role for the sales manager and add a Denied member set for the South clients.
    • D、Create a new role for the sales manager and add an Allowed member set for the South clients. Remove the sales manager from SouthAndWestRole.

    正确答案:D

  • 第21题:

    单选题
    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
    解析: 暂无解析

  • 第22题:

    单选题
    定义枚举如下:  public  enum  Direction{      EAST,SOUTH,WEST,NORTH      }  下列正确使用该枚举类型的语句是哪项?()
    A

    Direction Direction=EAST;

    B

    Direction direction=Direction.WEST;

    C

    int a- Direction.NORTH;

    D

    Direction direction=2;


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    class Parent {     String one, two;  public Parent(String a, String b){     one = a;     two = b;    }  public void print(){ System.out.println(one); }    }  public class Child extends Parent {     public Child(String a, String b){     super(a,b);     }  public void print(){  System.out.println(one + " to " + two);     }  public static void main(String arg[]){     Parent p = new Parent("south", "north");     Parent t = new Child("east", "west");     p.print();     t.print();     }     }  Which of the following is correct?()
    A

     Cause error during compilation. 

    B

     south         east 

    C

     south to north     east to west    

    D

     south to north      east    

    E

     south     east to west


    正确答案: D
    解析: 这个题目涉及继承时的多态性问题,在前面的问题中已经有讲述,要注意的是语句t.print();在运行时t实际指向的是一个Child对象,即java在运行时决定变量的实际类型,而在编译时t是一个Parent对象,因此,如果子类Child中有父类中没有的方法,例如printAll(),那么不能使用t.printAll()。