皮皮学,免费搜题
登录
搜题
【简答题】
阅读以下说明和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) } } }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】When you meet Tim Winton, it's easy to understand his success at writing for agers. He likes surfing and fishing and camping and hanging out in the vast tract of sand dunes that borders the one-pu...
A.
youthful and caring
B.
unprofessional and jaded
C.
educated and widely read
D.
unbiased and spontaneous
【简答题】Talk about one of your best friends. How and when did you meet? What did you do together? How and for how long have you kept your friendship? Anything special has happened during these years?
【简答题】In England people don't usually talk too much. You can go on a bus, or in a train, and everyone sits looking out of the window. Often they read. They read books and papers. But they don't talk much. W...
【简答题】In England people don't usually talk too much. You can go on a bus, or in a train, and everyone sits looking out of the window . They read books and papers .but they don't talk much. When you meet Eng...
【多选题】动物传种的行为包括()。
A.
筑巢
B.
求偶
C.
婚配
D.
抚育幼子
【单选题】Which one of the following greetings should you use when you meet someone in the afternoon?
A.
早上好!
B.
中午好!
C.
下午好!
D.
晚上好!
【判断题】“ 学”可以是巩固知识、技能的行为。而“习”是自学,也可以是别人教你。
A.
正确
B.
错误
【判断题】旅游购物不仅仅是商品的购买活动,还包括多种体验当地文化和传统的行为,这些行为共同构成一个完整的购物行为。( )
A.
正确
B.
错误
【简答题】In England people don’t usually talk too much. You can go on a bus, or in a train, and everyone sits looking out of the window. Often, they read. They read books and papers. But they don’t talk much. ...
【简答题】When you meet one of your old friends in the street, you haven't met him or her for a long time, how do you greet him or her? Make a dialogue with your partner in five minutes.
相关题目: