【计算机类职业资格】计算机二级JAVA-162 (1)及答案解析.doc

上传人:周芸 文档编号:1338273 上传时间:2019-10-17 格式:DOC 页数:4 大小:38KB
下载 相关 举报
【计算机类职业资格】计算机二级JAVA-162 (1)及答案解析.doc_第1页
第1页 / 共4页
【计算机类职业资格】计算机二级JAVA-162 (1)及答案解析.doc_第2页
第2页 / 共4页
【计算机类职业资格】计算机二级JAVA-162 (1)及答案解析.doc_第3页
第3页 / 共4页
【计算机类职业资格】计算机二级JAVA-162 (1)及答案解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机二级 JAVA-162 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、简单应用题(总题数:3,分数:100.00)1.本程序是一个 Applet,页面中有 10 个按钮,名称从“0”“9”,用鼠标任意单击其中一个按钮后,通过键盘上的上下左右键可以控制按钮在窗口上移动,如图所示。 (分数:30.00)_2.本程序中,主窗口中有一个按钮,按钮的长和宽每 200 毫秒增加 1,当达到 100 时又恢复原来大小重新进行增加,如图所示。 import java.awt.*; import java.awt.event.*; public class exam_94 public

2、static void main(String args) Mywin win=new Mywin(); class Mywin extends Frame _ Button b=new Button(“按钮“);int x=5; Thread bird=null; Mywin() setBounds(100,100,400,400);setLayout(new FlowLayout(); setTitle(“exam_94“); setVisible(true); add(b);b.setBackground(Color.green); addWindowListener(new Windo

3、wAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); bird=new Thread(this); bird.start(); public _ () while(true) x=x+1; if(x100) x=5; b.setBounds(40,40,x,x); try bird.sleep(200); catch(InterruptedException e) (分数:30.00)_3.本程序是一个 Applet,其功能是用户对文本框的输入,如果输入的是数字(09)或者是点(.),则接受并在文本框中显示

4、否则不接受,如图所示。 (分数:40.00)_计算机二级 JAVA-162 (1)答案解析(总分:100.00,做题时间:90 分钟)一、简单应用题(总题数:3,分数:100.00)1.本程序是一个 Applet,页面中有 10 个按钮,名称从“0”“9”,用鼠标任意单击其中一个按钮后,通过键盘上的上下左右键可以控制按钮在窗口上移动,如图所示。 (分数:30.00)_正确答案:()解析:第 1 处:implements KeyListener 第 2 处:keyPressed(KeyEvent e)2.本程序中,主窗口中有一个按钮,按钮的长和宽每 200 毫秒增加 1,当达到 100 时又恢

5、复原来大小重新进行增加,如图所示。 import java.awt.*; import java.awt.event.*; public class exam_94 public static void main(String args) Mywin win=new Mywin(); class Mywin extends Frame _ Button b=new Button(“按钮“);int x=5; Thread bird=null; Mywin() setBounds(100,100,400,400);setLayout(new FlowLayout(); setTitle(“exa

6、m_94“); setVisible(true); add(b);b.setBackground(Color.green); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); bird=new Thread(this); bird.start(); public _ () while(true) x=x+1; if(x100) x=5; b.setBounds(40,40,x,x); try bird.sleep(200); catch(InterruptedException e) (分数:30.00)_正确答案:()解析:第 1 处:implements Runnable 第 2 处:void run3.本程序是一个 Applet,其功能是用户对文本框的输入,如果输入的是数字(09)或者是点(.),则接受并在文本框中显示,否则不接受,如图所示。 (分数:40.00)_正确答案:()解析:第 1 处:extends PlainDocument 第 2 处:text.setDocument(document)

展开阅读全文
相关资源
猜你喜欢
  • NF V37-002-1975 Tobacco and tobacco products - Cigarettes on sale to the public - Sampling 《烟草和烟草制品 公共销售的卷烟 取样》.pdf NF V37-002-1975 Tobacco and tobacco products - Cigarettes on sale to the public - Sampling 《烟草和烟草制品 公共销售的卷烟 取样》.pdf
  • NF V37-003-1975 Tobacco and tobacco products Cigarettes on sale to the public Comparative determination of the tar and nicotine in the smoke 《烟草和烟草制品 公共销售的卷烟 烟中焦油和尼古丁的比较测定》.pdf NF V37-003-1975 Tobacco and tobacco products Cigarettes on sale to the public Comparative determination of the tar and nicotine in the smoke 《烟草和烟草制品 公共销售的卷烟 烟中焦油和尼古丁的比较测定》.pdf
  • NF V37-005-1997 Cigarettes Determination of alkaloids in smoke condensates Spectrometric method 《卷烟 烟雾凝聚物中生物碱的测定 光谱测定法》.pdf NF V37-005-1997 Cigarettes Determination of alkaloids in smoke condensates Spectrometric method 《卷烟 烟雾凝聚物中生物碱的测定 光谱测定法》.pdf
  • NF V37-006-1993 Tobacco and tobacco products Determination of alkaloid content Spectrometric method 《烟草和烟草制品 生物碱含量的测定 光谱测定法》.pdf NF V37-006-1993 Tobacco and tobacco products Determination of alkaloid content Spectrometric method 《烟草和烟草制品 生物碱含量的测定 光谱测定法》.pdf
  • NF V37-007-1992 Cigarettes Determination of alkaloid retention by the filters Spectrometric method 《卷烟 过滤嘴中生物碱滞留量的测定 光谱法》.pdf NF V37-007-1992 Cigarettes Determination of alkaloid retention by the filters Spectrometric method 《卷烟 过滤嘴中生物碱滞留量的测定 光谱法》.pdf
  • NF V37-009-2004 Tobacco and tobacco products - Cigarettes - Determination of free rate combustion 《烟草和烟草制品 卷烟 自燃速度的测定》.pdf NF V37-009-2004 Tobacco and tobacco products - Cigarettes - Determination of free rate combustion 《烟草和烟草制品 卷烟 自燃速度的测定》.pdf
  • NF V37-015-1-1997 Cigarettes Determination of loss of tobacco from the ends Part 1  method using a rotating cylindrical cage 《卷烟 烟草端损失的测定 第1部分 圆柱形旋转架法》.pdf NF V37-015-1-1997 Cigarettes Determination of loss of tobacco from the ends Part 1 method using a rotating cylindrical cage 《卷烟 烟草端损失的测定 第1部分 圆柱形旋转架法》.pdf
  • NF V37-015-2-1997 Cigarettes Determination of loss of tobacco from the ends Part 2  method using a rotating cubic box (sysmelatophore) 《卷烟 烟草端损失的测定 第2部分 使用旋转立方盒法(sysmelatophore)》.pdf NF V37-015-2-1997 Cigarettes Determination of loss of tobacco from the ends Part 2 method using a rotating cubic box (sysmelatophore) 《卷烟 烟草端损失的测定 第2部分 使用旋转立方盒法(sysmelatophore)》.pdf
  • NF V37-016-1992 Cigarettes Determination of the smoke condensate retention index of a filter Direct spectrometric method 《卷烟 过滤嘴的香烟冷凝液存留指数的测定 直接光谱测定法(ISO-4388-92)》.pdf NF V37-016-1992 Cigarettes Determination of the smoke condensate retention index of a filter Direct spectrometric method 《卷烟 过滤嘴的香烟冷凝液存留指数的测定 直接光谱测定法(ISO-4388-92)》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1