问题 选择题

时至2012年2月3日,由中央电视台推出的《感动中国》年度人物评选活动已举办整整10年。有人说,每年的《感动中国》节目就像是“中国人的年度精神史诗”。10年,《感动中国》有100多位获奖人物和群体。举办此评选活动属于     建设,能为我国的现代化建设事业提供      

A.文化、物质基础

B.精神文明、智力支持

C.政治、思想保证

D.思想道德、精神动力

答案

D 。

这一活动的开展,是加强先进文化建设特别是思想道德建设的体现,弘扬了社会正气,促进了精神文明建设。应选D。

选择题
问答题

请完成下列Java程序:制作一个图形用户界面,上方包含一个TextField和Button构件,实现输入字符串,点击Button获取文本区的字符:中间显示Label的内容:下方是4个按钮,分别实现控制Label在最左边,在中间,在右边和退出程序的功能。
注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。
程序运行结果如下:


import java.awt.*;
import java.awt.event.*;
public class ex15_2 extends Frame implements ActionListener
private Label 1;
private TextField tf;
public static void main(String[] args)
ex15_2 obj15_2 = new ex15_2();

public ex15_2()
setBackground(Color.gray);
l = new Label("Welcom to the NCR Examination!");
Font font = new Font("TimesRoman",Font.BOLD,20);
l.setFont(font);
add("Center",l);
Panel p = new Panel();
Button b = new Button("Left");
b.addActionListener(this);
p.add(b);
b = new Button("Center");
b.addActionListener(this);
p.add(b);
b = new Button("Right");
b.addActionListener(this);
p.add(b);
________________;
b = new Button("Exit");
b.addActionListener(this);
p.add(b);
p = new Panel();
tf = new TextField(40);
p.add(tf);
b = new Button("Set");
b.addActionListener(this);
p.add(b);
add("North",p);
setSize(500,300);
show();

public void actionPerformed(ActionEvent ae)
if(ae.getActionCommand().equals("Exit"))
System.exit(0);
else if(ae.getActionCommand().equals("Left"))
____________________;
else if(ae.getActionCommand().equals("Center")
l.setAlignment(Label.CENTER);
else if(ae.getActionCommand().equals("Right"))
l.setAlignment(Label.RIGHT);
else if(ae.getActionCommand().equals("Set"))
l.setText(tf.getText());