单选题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 GridLayout
单选题
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
参考解析
解析:
这个还是布局管理器的问题,流布局管理器(FlowLayout)将根据框架的大小随时调整它里面的组件的大小,包括高度和宽度,这个管理器不会约束组件的大小,而是允许他们获得自己的最佳大小,一行满了以后将在下一行放置组件;卡片管理器(CardLayout)一次显式一个加入的组件(根据加入时的关键字);网格管理器(GridLayout)将容器划分为固定的网格,容器大小的改变将影响所有组件的大小,每个组件的大小都会同等地变化;边界管理器(BorderLayout)将容器划分为五个区域,分为东南西北和中间,东西区域的宽度为该区域里面组件的最佳宽度,高度为容器的高度减去南北区域的高度,这是一个可能变化的值,而南北区域的宽度为容器的整个宽度,高度为组件的最佳高度,中间区域的高度为容器的高度减去南北区域的高度,宽度为容器的宽度减去东西区域的宽度。
相关考题:
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 widthB.Button One change heightC.Button Two change height and Button Three change widthD.Button Four change height and width
定义枚举如下:publicenumDirection{EAST,SOUTH,WEST,NORTH}下列正确使用该枚举类型的语句是哪项?() A.DirectionDirection=EAST;B.Directiondirection=Direction.WEST;C.inta-Direction.NORTH;D.Directiondirection=2;
下列程序用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));
下列程序在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());
下列程序采用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("北方"));
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 buoyB.you should stay to the west or south of the buoyC.the buoy is a major lighted buoyD.nothing special for navigational purposes
If the center of low pressure is due west of you in the Northern Hemisphere, which wind direction should you expect?A.South to westB.South to eastC.West to northD.North to east
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 westB.South to eastC.North to westD.North to east
Tasmania is an island which lies()of the Australian mainland.A、north of the northeastern cornerB、south of the southeastern cornerC、east of the northeastern comerD、west of the southeastern corner
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
Which layout manager is used when the frame is resized the buttons’s position in the Frame might be changed?() A、 BorderLayoutB、 FlowLayoutC、 CardLayoutD、 GridLayout
New Zealand is situated about 1, 500 km ()A、north-west of AustraliaB、south-east of AustraliaC、north-east of AustraliaD、south-west of Australia
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.
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、 GridLayout
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.
Which tool in the layout model could you use to create an external boiler plate object?()A、Field B、Frame C、Button D、RectangleE、Link file
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.
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.
单选题Which statement is true about mouse events? ()AThe cursor style can be set to CAUTION. BDouble-clicking a mouse button can potentially fire six mouse event triggers. CThe values for the SYSTEM.MOUSE_BUTTON_PRESSED system variable can only be 1 or 2. DClick and double-click button actions can only detect if the mouse is positioned in an item.
单选题The buoy symbol printed on your chart is leaning to the northeast. This indicates ().Ayou should stay to the north or east of the buoyByou should stay to the west or south of the buoyCthe buoy is a major lighted buoyDnothing special for navigational purposes
单选题Which layout manager is used when the frame is resized the buttons’s position in the Frame might be changed?()A BorderLayoutB FlowLayoutC CardLayoutD GridLayout
单选题定义枚举如下: public enum Direction{ EAST,SOUTH,WEST,NORTH } 下列正确使用该枚举类型的语句是哪项?()ADirection Direction=EAST;BDirection direction=Direction.WEST;Cint a- Direction.NORTH;DDirection direction=2;
单选题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.AFathoms and metersBMiles and kilometersCArc and degreesDDegrees and minutes
单选题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
单选题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?()AAdd a Denied member set for the West clients to NorthRole.BAdd an Allowed member set for the South clients to NorthRole.CCreate a new role for the sales manager and add a Denied member set for the South clients.DCreate a new role for the sales manager and add an Allowed member set for the South clients. Remove the sales manager from SouthAndWestRole.