皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
下面是一个Applet程序,其功能是有2个按钮,分别为First和Second,以及一个Labe1构件。要求点击First时则能在 Labe1中显示出Command:First,而点击Second时则能显示出Command:Second,要求只能使用重载一次actionPerformed()方法。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。 注意:不改动程序的结构,不得增行或删行。 程序运行结果如下: import java.awt.*; import java.awt.event.*; import java.applet.*; /* <applet code=ex2_3.class width=800 height=400> </applet> */ public class ex2_3 extends Applet implements ActionListener { private String str='ok'; private Labe1 1; private Button btn; public void init() { setLayout(null); 1=new Label(str); 1.reshape(10, 10, 150, 30); add(1); btn = new Button('First'); btn.reshape(10, 50, 60, 20); 1.addActionListener(this); add(btn); btn = new Button('Second'); btn.reshape(10, 100, 60, 20); btn.setActionCommand('First'); btn.addActionListener(this); add(btn); } public void actionPerformed(ActionEvent ae) { str='Command: ' +ae.getActionCommand(); btn.setText(str); } } ex2_3.htm1 <HTML> <HEAD> <TITLE>ex2_3</TITLE> </HEAD> <BODY> <applet code='ex2_3.class' width=800 height=400 > </applet> </BODY> </HTML>
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】When you want to express impossibility, you may say______
A.
There is no possibility that I can help you
B.
It’s a possibility.
C.
I might be able to hep you
【判断题】所有标准平衡常数都是量纲为 1 的。
A.
正确
B.
错误
【单选题】what do you say if you want to express your enjoyment of something
A.
I very like it.
B.
I like it very much.
【单选题】与“关键词”相比,“主题”
A.
检索的全面性更好
B.
检索的准确性更高
C.
属于规范语言,使用难度较大
D.
以上均非
【单选题】If you want to express it tastes very sweet , you can say
A.
zhēnɡuì 真贵
B.
zhēntián 真甜
C.
zhēnhǎo 真好
【单选题】与“关键词”相比,“主题”()
A.
检索的准确性更高
B.
属于规范语言,使用难度大
C.
检索的全面性较好
D.
以上均是
【单选题】与“关键词”相比,“主题”()
A.
检索的准确性更高
B.
以上均非
C.
以上均是
D.
检索的全面性较好
【单选题】2019年6月18日电,国家禁毒办日前召开新闻发布会,发布《2018中国毒品形势报告》。报告指出,2018年,中国现有吸毒人数占全国人口总数的0.18%,首次出现下降。同时,报告也显示,目前( )成为滥用“头号毒品”,“互联网+物流”则成了贩毒活动主要方式。
A.
海洛因
B.
冰毒
C.
摇头丸
D.
吗啡
【单选题】You want to express your love, then how to say?
A.
You’re the girl of my dreams.
B.
I fell in love with you at first sight.
C.
I’m thinking of you every minute.
D.
all of the above
【单选题】与“关键词”相比,“主题”
A.
属于规范语言,使用难度较大
B.
检索的全面性更好
C.
检索的准确性更高
D.
以上均非
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题