Public choice公共选择
第1题:
请完成下列Java程序:创建一个具有2行3列的GridLayout管理器,包括Choice、Label、Button构件,布局为第1行包括一个Choice构件(包括2个选项item1和item2)、一个Label构件(当选择Choice构件中的选项时,Labe1构件显示相应的名称,即如果点击item1则Labe1中显示item1)和一个exit按钮(点击则退出应用程序),第2行包括3个Button构件。程序运行结果如下。

注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。
源程序文件清单如下:
import java.awt.*;
import java.awt.event.*;
public class ex11_2 extends Frame. implements ActionListener, ItemListener
{
private Label 1;
private String str="label";
private Choice choice11_2;
public static void main(String[] arg)
{
new ex11_2();
}
ex11_2 ()
{
setLayout (______);
choice11_2 = new Choice();
choice11_2.addItem("item1");
choice11_2.addItem("item2");choice11_2.______;
add(choice11_2);
l=new Label(str);
add(l);
Button exit11_2 = new Button("exit");
exit11_2.addActionListener(this);
add(exit11_2);
for(int i=0; i<3; i++)
add(new Button("button" + i));
setSize(300,300);
pack();
show();
}
public void actionPerformed(ActionEvent event)
{
if (event.getActionCommand ( ). equals ( "exit" ) )
{
System.exit(0);
}
}
public void itemStateChanged(ItemEvent event
{
str=choice11_2.getSelectedItem();
l.setText(str);
}
}
第2题:
A. Choice, MULTIPLE
B. Choice, IMPLICIT
C.Choice. EXCLUSIVE
D.Choice.POPUP
第3题:
第4题:
在Java语言中,下列组件可以让用户选择多个选项有()。
第5题:
行政管理是英文()一词的汉译,传统上亦称公共行政或公共行政管理。
第6题:
逆向选择(Adverse choice)
第7题:
选择反应时(choice reaction time)
第8题:
“公共关系”这个词是由英文()翻译过来的,简称“PR”。
第9题:
公共关系的英文是()。
第10题:
第11题:
第12题:
Throughput results are valid as a value from the Teleworker's home to the corporate site, regardless of the location of the public test server.
Throughput results may not be valid due to the public server's location on the Internet and fluctuations based on the use of the public server.
Throughput values are not affected by the choice of split tunneling or Internet access through the VPN.
Throughput results are unrelated to the Teleworker PC configuration or current PC use.
第13题:
下列组件中没有选择项的是( )。
A.Button
B.CheckBox
C.List
D.Choice
第14题:
本题的功能是对下拉菜单项的操作,包括添加和删除。页面包括一个下拉菜单、一个文本框和两个按钮“删除”和“添加”,选中下拉菜单的一项后,可以通过“删除”按钮从下拉菜单中删除该项,在文本框中填入字符串后,单击“添加”按钮就可以将该项添加到下拉菜单中,所有信息都将显示在右侧的文本域中。
import java.awt.*;
import java.awt.event.*;
public class java2 extends java.applet.Applet imple-
ments hemListener,ActionListener
{Choice choice;
TextField text;
TextArea area;
Button add,del;
public void init() .
{choice:new Choice();
text=new TextField(8);
area:new TextArea(6,15);
choice.add("音乐天地");
choice.add("武术天地");
choice.add("象棋乐园");
choice.add("交友聊天");
add=new Button("添加");
del=new Button("删除");
add.addActionListener(this);
del.addActionListener(this);
choice.addItemListener(this);
add(choice);
add(del);add(text);add(add);add(area);
}
public void itemStateChanged(hemEvent e)
{String name= ;
int index=choice.getSelectedIndex();
area.setText("\n"+index+":"+name);
}
public void actionPerformed(ActionEvent e)
{if(e.getSource()= =add||e.getSource()= =
text)
{String name=text.getText();
if(name.length()>;0)
{choice.add(name);
choice.select(name);
area.append("\n添加"+name);
}
}
else if(e.getSource()= =del)
{choice.remove( );
area.append("\n删除"+choice.getSelectedItem
());
}
}
}
第15题:
在《正义论》中,public goods可被翻译为公共益品。
第16题:
公共关系的英文是()。
第17题:
Public good 公共品
第18题:
公共场所()
第19题:
公共关系的英文是()
第20题:
interface Animal { void soundOff(); } class Elephant implements Animal { public void soundOff() { System.out.println(“Trumpet”); } } class Lion implements Animal { public void soundOff() { System.out.println(“Roar”); } } class Alpha1 { static Animal get( String choice ) { if ( choice.equalsIgnoreCase( “meat eater” )) { return new Lion(); } else { return new Elephant(); } } } Which compiles?()
第21题:
西方“公共”(public)一词有多重涵义,主要包含()。
第22题:
new Animal().soundOff();
Elephant e = new Alpha1();
Lion 1 = Alpha.get(“meat eater”);
new Alpha1().get(“veggie”).soundOff();
第23题:
harder to make a choice between public and private schools
harder to go to private schools this year than before
more difficult to go to public schools than to private schools
as difficult to go to private schools this year as before