【计算机类职业资格】计算机二级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)

展开阅读全文
相关资源
猜你喜欢
  • BS ISO 834-10-2014 en_5766  Fire resistance tests Elements of building construction Specific requirements to determine the contribution of applied fire protection.pdf BS ISO 834-10-2014 en_5766 Fire resistance tests Elements of building construction Specific requirements to determine the contribution of applied fire protection.pdf
  • BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf BS PD IEC TS 62763-2013_5284 Pilot function through a control pilot circuit using PWM (pulse width modulation) and a control pilot wire《通过控制导向线使用PWM (脉冲宽度调制) 的导向功能和控制导向线》.pdf
  • BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf BS ISO 8070-2007 Milk and milk products - Determination of calcium sodium potassium and magnesium contents - Atomic absorption spectrometric method《牛奶和奶制品 钙、钠、钾和镁含量的测定 原子吸.pdf
  • BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf BS ISO 8082-1-2009 Self-propelled machinery for forestry - Laboratory tests and performance requirements for roll-over protective structures - General machines《林业用自推进机械 防倾.pdf
  • BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf BS ISO 8082-2-2011 Self-propelled machinery for forestry Laboratory tests and performance requirements for roll-over protective structures Machines having a rotating platf.pdf
  • BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf BS ISO 8083-2006 Machinery for forestry - Falling-object protective structures (FOPS) - Laboratory tests and performance requirements《林业机械 落体防护装置(FOPS) 实验室试验和性能要求》.pdf
  • BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf BS ISO 8086-2004 Dairy plant - Hygiene conditions - General guidance on inspection and sampling procedures《乳品厂 卫生条件 检验和取样程序通用指南》.pdf
  • BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf BS ISO 8096-2005 Rubber- or plastics-coated fabrics for water resistant clothing - Specification《雨衣用橡胶或塑料涂覆织物 规范》.pdf
  • BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf BS ISO 8097-2001 Aircraft Minimum airworthiness requirements and test conditions for certified air cargo unit load devices《航空器 经认证的航空货运集装单元装置最低适航性要求和试验条件》.pdf
  • 相关搜索

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

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