题目
第1题
A.Label和Label
B.Label1和Label1
C.Label1和Visual Basic
D.Label和Caption
第2题
在窗体form1 的Click事件过程中有以下语句: Label1. Caption = "Visual Basic" 若本语句执行前,标签控件的Caption属性取默认值,则该标签控件的名称属性和Caption属性在执行本语句前的取值分别为 ______。
A.Label,Label1
B.Label,Caption
C.Label1,Label1
D.Caption,Label
第3题
A.h_1=uimenu(gcf,'Label','&Blue');
B.h_1=uicontrol(gcf,'style','push', 'string','grid off','callback','grid off');
C.h_1=uicontrol(gcf,'style','text', 'horizontal','left','string',{'输入'});
D.h_1=axes('unit','normalized','position',[0,0,1,1],'visible','off');
第4题
A.h_1=uimenu(gcf,'Label','&Blue');
B.h_1=uicontrol(gcf,'style','push', 'string','grid off','callback','grid off');
C.h_1=uicontrol(gcf,'style','text', 'horizontal','left','string',{'输入'});
D.h_1=axes('unit','normalized','position',[0,0,1,1],'visible','off');
第5题
●试题六
阅读以下说明和Java代码,将解答写入答题纸的对应栏内。
【说明】
下面是一个Applet程序,其功能是输出已定义好的两个变量x和chr。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。
注意:不改动程序的结构,不得增行或删行。
import javA.awt.*;
(1) import javA.Applet;
(2) public class MyApplet implements Applet
{
int x=10;
(3) char chr="R";
Label output1;
Label output2;
(4) private void init()
{
output1=new Label("定义int类型变量"+"x,的初值为"+x);
output2=new Label("定义char类型变量"+"chr,的初值为"+chr);
add(output1);
add(output2);
}
}
<HTML>
<HEAD>
<TITLE>ex34_3</TITLE>
</HEAD>
<BODY>
(5) <applet class="MyApplet.class"
width=400 height=400 >
</applet>
</BODY>
</HTML>
第6题
注意:请勿改动main()主方法和其他已有语句内容,仅在横线处填入适当语句。
import java.awt.*;
import java.awt.event.*;
public class Example2_6 extends Frame
{
public static void main(String [] argv)
{
Example2_6 frame. = new Example2_6("Example2_6");
frame, init ();
frame.setSize(300, 300);
frame, show ();
}
public Example2_6(String name)
{
super (name);
addWindowListener (new WindowAdapter ()
{ public void windowClosing(WindowEvent e)
{ __________;
}
} );
}
public void init()
{
setLayout (new ___________);
Label labelTitle = new Label("在文本框中输入字符串,可以在Frame. 中间显示");
Label showTextLabel = new Label();
TextField textField = new TextField("请在这里输入字符串");
textField.addActionListener (new AddStringListener(showTextLabel, textField) );
add("North", labelTitte);
add("Center", showTextLabel);
add("South", textField);
}
}
class AddStringListener implements ActionListener
{
Label label;
TextField textField;
public AddStringListener(Label label, TextField textField)
{
this. label = label;
this.textField = textField;
}
public void actionPerformed(ActionEvent e)
{
label, setText (textField. getText ());
}
}
第7题
A.TextView tv=this.findViewById(R.id.label);
B.TextView tv=(TextView)findViewById(R.id.label);
C.TextView tv=(TextView)findViewById(R.layout. label);
D.TextView tv=(TextView)findViewById(R.string.label);
第9题
A.TextView tv=this.findViewById(R.id.label);
B.TextView tv=(TextView)findViewById(R.id.label);
C.TextView tv=(TextView)findViewById(R.layout. label);
D.TextView tv=(TextView)findViewById(R.string.label);
第10题
阅读以下说明和Java代码,将解答写入对应栏内。
【说明】
请完成下列Java程序。程序的执行结果是生成一个具有一个TextField类型的对象in、 Button类型的对象btn和Label类型的对象out图形用户界面,程序的功能是计算用户输入数的平方,如图3所示。
注意:请勿改动main()主方法和其他已有的语句内容,仅在下划线处填入适当的语句。
【程序】
import java. awt.*;
import java, awt. event.*;
public class square {
public static void main(String args[ ]){
(1)
}
}
class AppFrame. extends Frame{
TheAdapterTest listener = new TheAdapterTest();
Text Field in = new TextField (5);
Button btn = new Button("计算");
Label ut = new Label("用于显示计算结果");
public AppFrame()
{
setLayout(new FlowLayout());
add(in);
add(btn)
add(out);
btn. addActionListener(new BtnActionAdapter());
addWindowListener (listener);
setSize(400,100);
show();
}
class BtnActionAdapter implements (2) {
public void actionPerformed((3)) {
String s = in. getText();
double d =(4)
double sq = d * d;
out. setText(d+"的平方是:" +sq);
}
}
class TheAdapterTest extends WindowAdapter
{
public void windowCIosing((5))
{
System. exit(1)
}
}
}
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!