皮皮学,免费搜题
登录
搜题
【简答题】
阅读以下说明和Java代码,将入(n)处的字句写在对应栏内。 【说明】 下面的Java程序演示了如何使用Applet在网页上显示图形用户界面CUI(graphical user interface),该实例显示一个时钟。每当浏览器显现Applet的内容调用start()函数,让applet得以开始工作(尤其时那些被stop()函数所关闭的工作)。每当浏览器不再显现Applet的内容调用stop()函数,让applet得以关闭某些甚耗资源的工作调用destroy()函数之后也会调用此函数。每当浏览器将Applet从网页移除调用destroy()函数,已执行'applet不再被使用时'应该做的最后释放资源等动作。每当调用repaint()函数时,或网页窗口须重新刷新时调用paint()函数。 【Java程序】 import java.applet.*; import java.awt.*; public class ClockApplet extends (1) implements Runnable { //运行函数,每隔一秒刷新一次时间 public void run(){ while (true){ try{ Thread.sleep(1000); } catch (InterruptedException e){} (2); //刷新当前时间 } } public void start(){ //调用此函数,并根据条件启动时钟线程或重起线程 if( clockThread= =null){ clockThread = new Thread(this); clockThread. start();//启动新创建的线程 } else clockThread.(3);//恢复挂起的线程 } public void stop(){ //挂起时钟线程 if (clockThread ! = null) clockThread. (4); } public void destroy(){//停止时钟线程 if (5) { clockThread.stop(); clockThread = null; } } public void paint(Graphics g){//在网页上重新显示时间 g. drawString( new java.util. Date().toString(), 10,30); } private Thread clockThread; }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】Which of the following statements is NOT true about the general election?
A.
During the general election, Americans cast their votes.
B.
The votes in the general election determine the final winner.
C.
The general election is often referred to as midterm election, or indirect election.
D.
The general election is the 3 rd step in the presidential election in the United States.
【单选题】CA6140型卧式车床的主轴正转有( )级转速。
A.
21
B.
24
C.
12
D.
30
【单选题】CA6140型卧式车床的主轴反转有( )级转速。
A.
21
B.
24
C.
12
D.
30
【单选题】The most important election in the US is _______.
A.
the presidential election
B.
the by-election
C.
the state election
D.
the local election
【单选题】HTML 中,下面是段落标签的是
A.
....
B.
................
C.
....
D.
....
【单选题】What caused the opposite parties to quit the election?
A.
The election are not so impartial as expected.
B.
The president asked them to drop out from it.
C.
They are not confident in themselves.
D.
They are afraid of being cheated and attacked.
【单选题】少尿型急性肾衰竭少尿期中,对患者危害最大的是
A.
少尿
B.
水中毒
C.
高钾血症
D.
代谢性酸中毒
【单选题】在HTML中,下面是段落标签的是
A.
html
B.
body
C.
head
D.
p
【单选题】听力原文: Here is our news about the European election. This election was a damning indictment of Europe's current political leaders. Most people either voted for opposition parties or didn't bother to vo...
A.
They are really bad as political leaders.
B.
They are good as political leaders.
C.
They are good, but also are opposed by some people.
D.
People do not care what they do.
【单选题】The election didn't have representativeness because ______.
A.
the results of the election were hardly persuasive
B.
only a small percentage of students participated in the election
C.
the election was not organized in a constructive way
D.
the teachers involved are not given details of the reasons for voting
相关题目: