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

在Java中,下列代码段允许按钮注册一个action事件的是()。 A.button.enableActionEvents();B.button.addActionListener(anActionListener);C.button.enableEvents(true);D.button.enableEvents(AWTEvent.ACTION_EVENT_MASK);

下列程序使用FlowLayout布局管理器管理3个Button构件在Frame中的位置。请将程序补充完整。注意:不改动程序结构,不得增行或删行。import java.awt.*;public class ex2{private Frame. frm;private Button btn1;private Button btn2;private Button btn3;public static void main(String[] args){ex2 t=new ex2();t.method();}public void method(){frm=new Frame("ex2")______Btn1=new Button("Button1");btn2=new Button("Button2");btn3=new Button("Button3");frm.add(btn1);frm.add(btn2);______frm.pack();frm.setVisible(true);}}

选择正确的叙述. class Happy extends Frame. { Happy() { SetLayout(new GridLayout(2,2)); Panel p1 = new Panel(); add(p1); p 1.add( new Button("One")); Panel p2 = new Panel(); add(p2); p 2.add( new Button("Two")); add( new Button("Three")); add( new Button("Four")); s()A.当frame调整大小时,按钮Three和Four 的大小也将调整。B.当frame调整大小时,所有按钮的大小都将调整。C.当frame调整大小时,按钮Two和Four 的大小也将调整。D.当frame调整大小时,按钮One和Two 的大小也将调整。

Whichtwostatementsaretrueaboutmousebuttonvariables?() A.SYSTEM.MOUSE_BUTTON_PRESSEDreturnsastring.B.SYSTEM.MOUSE_BUTTON_PRESSEDreturnsanumericvalue.1Z0-132WorldLeadersIn CertificationsMaterial-Test-king.comC.ApossiblevalueforSYSTEM.MOUSE_BUTTON_MODIFIERSisControl+Alt+Delete.D.SYSTEM.MOUSE_BUTTON_MODIFIERScanonlybereferencesinform-leveltriggers.E.SYSTEM.MOUSE_BUTTON_MODIFIERSidentifieswhichspecialkeywaspressedinconjunctionwiththeusualmousebuttonaction.

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

阅读下面代码:import java.awt.*;public class Exam11_1{private Frame. f;private Button b1,b2,b3,b4;public static void main(String args[]{Exam11_1 that = new Exam11 1 ();that.go();}public void go(){______;f.setLayout(new FlowLayout()) ;;b1 = new Button ("Button 1");b2 = new Button ("Button 2");b3 = new Button ("Button 3");b4 = new Button ("Button 4");f.add (b1);f.add (b2);f.add (b3);f.add (b4);f.pack ();f.setVisible (true);}}请在程序中画线处填写正确的语句【 】,以便编译运行程序后得到正确的结果。

下列程序采用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("北方"));

本题中,主窗口有一个按钮“打开对话框”和一个文本域,单击按钮“打开对话框”后会弹出一个对话框,对话框上有两个按钮“Yes"和“N0”,单击对话框上的“Yes”和“N0”按 钮后返回主窗口,并在右侧文本域中显示刚才所单击的按钮信息。import java.awt.event.*;import java.awt.*;class MyDialog implements ActionListener{static final int YES=1,N0=0;int message=-1;Button yes,no;MyDialog(Frame. f.String S,boolean b){super(f,S,b);ves=new Button("Yes");yes.addActionListener(this);no=new Button("No"); no.addActionListener(this)osetLayout(new FlowLayout());add(yes);add(no);setBounds(60,60,100,100);addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){message=-1;setVisible(false);)});}public void actionPerformed(ActionEvent e){if(e.getSource()= =yes){message=YES;setVisible(false);}else if(e.getSource()= = no){message=NO;setVisible(false);}}public int getMessage(){return message;}}class Dwindow extends Frame. implements ActionLis-tener{TextArea text;Button button;MyDialog dialog;Dwindow(String s){super(s);text=new TextArea(5,22);button=new Button("打开对话框");button.addActionListener(this);setLayout(new FlowLayout());add(button);add(text);dialog=new MyDialog(this,"Dialog",true);setBounds(60,60,300,300);setVisible(true);validate();addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){System.exit(0);}});}public void actionPerformed(ActionEvent e){if(e.getSource()= =button){if(dialog.getMessage()= =MyDialog.YES){text.append("\n你单击了对话框的yes按钮");}else if(dialog.getMessage()= =MyDialog.NO){text.append("\n你单击了对话框的N0按钮");}}}}public class java2{public static void main(String args[]){new Dwindow("java2");}}

import java.awt.*;  import java.applet.*;  public class ButtonDemo extends Applet{   public void init()  {    Button pushBotton=new Button(“ok”);    Button downBotton=new Button(“Yes”);     add(pushBotton);     add(downBotton);   } }  根据以上代码,下列结束正确的是()A、该代码画了一个按钮B、Button(“ok”)创建一个有显示”ok”的按钮C、Button()是构造函数D、按钮属于容器

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a Button control for the application. You need to ensure that the application meets the following requirements: When the mouse pointer is over the Button control, the background color of the button is set to red and the Button control appears bigger. When the mouse pointer is not over the Button control, the button returns to its original state. What should you do?()A、Create a template. Declare a VisualState element in the template.B、Create a StoryBoard animation. Add an EventTrigger class to the Button control that begins the StoryBoard animation.C、Create a ScaleTransform class. Bind the ScaleX and ScaleY properties of the Button control to the Background property by using a custom value converter.D、Add a method named ChangeAppearance in the code-behind file. Subscribe the ChangeAppearance method to the MouseEnter event of the Button control.

What will be the appearance of an applet with the following init() method?   public void init() {   add(new Button("hello"));  }  A、Nothing appears in the applet.B、A button will cover the whole area of the applet.C、A button will appear in the top left corner of the applet.D、A button will appear, centered in the top region of the applet.E、A button will appear in the center of the applet.

以下关于jQuery点击事件正确的是()。A、$(’button’).onclick()B、$(’button’).onclick(function(){})C、$(’button’).on(’click’,function(){})D、$("button").click(function(){})

在JAVA中,下列()代码段允许按钮注册一个action事件。A、button.enableActioinEvents();B、button.addActionListener(anActionListener);C、button.enableEvents(true);D、button.enableEvents(AWTEvent.ACTION_EVENT_MASK);

import java.awt.*;   public class Test extends Frame {   public Test() {   add(new Label(“Hello”) );   add(new TextField(“Hello”) );   add(new Button(“Hello”) );   pack();   show();    }   public static void main(String args) {   new Test ();   }   }   What is the result? () A、 The code will not compile.B、 A Window will appear containing only a Button.C、 An IllegalArgumentException is thrown at line 6.D、 A Window button will appear but will not contain the Label, TextField, or Button.E、 A Window will appear containing a Label at the top, a TextField below the Label, and a Button  below the TextField.F、 A Window will appear containing a Label on the left, a TextField to the right of the Label, and a button to the right of the TextField.

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

Which two statements are true about mouse button variables?()A、SYSTEM.MOUSE_BUTTON_PRESSED returns a string. B、SYSTEM.MOUSE_BUTTON_PRESSED returns a numeric value. 1Z0-132 World Leaders In Certifications Material - Test-king.com C、A possible value for SYSTEM.MOUSE_BUTTON_MODIFIERS is Control+Alt+Delete. D、SYSTEM.MOUSE_BUTTON_MODIFIERS can only be references in form-level triggers. E、SYSTEM.MOUSE_BUTTON_MODIFIERS identifies which special key was pressed in conjunction with the usual mouse button action.

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.

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

单选题在Java中,下列代码段允许按钮注册一个Action事件的是()A Button.enableActionEvents()B Button.addActionListener(anActionListener)C Button.enableEvents(true)D Button. enableEvents (AWTEvent.Action_EVENT_MASK)

单选题What will be the appearance of an applet with the following init() method?   public void init() {   add(new Button("hello"));  }ANothing appears in the applet.BA button will cover the whole area of the applet.CA button will appear in the top left corner of the applet.DA button will appear, centered in the top region of the applet.EA button will appear in the center of the applet.

多选题Which two statements are true about mouse button variables?()ASYSTEM.MOUSE_BUTTON_PRESSED returns a string.BSYSTEM.MOUSE_BUTTON_PRESSED returns a numeric value. 1Z0-132 World Leaders In Certifications Material - Test-king.comCA possible value for SYSTEM.MOUSE_BUTTON_MODIFIERS is Control+Alt+Delete.DSYSTEM.MOUSE_BUTTON_MODIFIERS can only be references in form-level triggers.ESYSTEM.MOUSE_BUTTON_MODIFIERS identifies which special key was pressed in conjunction with the usual mouse button action.

多选题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?()AThe buttons labeled “North” and “South” will have the same width.BThe buttons labeled “North” and “South” will have the same height.CThe height of the button labeled “North” can very if the Frame is resized.DThe height of the button labeled “South” can very if the Frame is resized.EThe width of the button labeled “North” is constant even if the Frame is resized.FThe 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

单选题在Android中,对话框内哪个是“确定”按钮?()Aset Negative Button()Bset Neutral Button()Cset Positive Button()Dset Neutraled Button()

多选题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? ()AAll the buttons change height if the frame height is resized.BAll the buttons change width if the Frame width is resized.CThe size of the button labeled “One” is constant even if the Frame is resized.DBoth width and height of the button labeled “Three” might change if the Frame is resized.

多选题以下关于jQuery点击事件正确的是()。A$(’button’).onclick()B$(’button’).onclick(function(){})C$(’button’).on(’click’,function(){})D$(button).click(function(){})

单选题import java.awt.*;   public class Test extends Frame {   public Test() {   add(new Label(“Hello”) );   add(new TextField(“Hello”) );   add(new Button(“Hello”) );   pack();   show();    }   public static void main(String args) {   new Test ();   }   }   What is the result? ()A The code will not compile.B A Window will appear containing only a Button.C An IllegalArgumentException is thrown at line 6.D A Window button will appear but will not contain the Label, TextField, or Button.E A Window will appear containing a Label at the top, a TextField below the Label, and a Button  below the TextField.F A Window will appear containing a Label on the left, a TextField to the right of the Label, and a button to the right of the TextField.