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

展开阅读全文
相关资源
猜你喜欢
  • EN 2802-2005 en Aluminium alloy AL-P7475-T761 Sheet and strip 0 6 mm less than or equal to a less than or equal to 6 mm《航空航天系列 铝合金AL-P7475-T761 薄板和带材 0 6 mm≤a≤ 6 mm》.pdf EN 2802-2005 en Aluminium alloy AL-P7475-T761 Sheet and strip 0 6 mm less than or equal to a less than or equal to 6 mm《航空航天系列 铝合金AL-P7475-T761 薄板和带材 0 6 mm≤a≤ 6 mm》.pdf
  • EN 2803-2005 en Aluminium alloy AL-P7475-T761 Clad sheet and strip 1 0 mm Less Than or Equal to a Less Than or Equal to 6 mm《航空航天系列 铝合金AL-P7475-T761 覆层薄板和带材 1 0 mm≤a≤6 m》.pdf EN 2803-2005 en Aluminium alloy AL-P7475-T761 Clad sheet and strip 1 0 mm Less Than or Equal to a Less Than or Equal to 6 mm《航空航天系列 铝合金AL-P7475-T761 覆层薄板和带材 1 0 mm≤a≤6 m》.pdf
  • EN 2808-1997 en Aerospace Series - Anodizing of Titanium and Titanium Alloys《航空航天系列 钛和钛合金阳极氧化》.pdf EN 2808-1997 en Aerospace Series - Anodizing of Titanium and Titanium Alloys《航空航天系列 钛和钛合金阳极氧化》.pdf
  • EN 2809-2001 en Aerospace Series - Nuts Hexagon Slotted Castellated Reduced Height Normal Across Flats in Heat Resisting Steel Silver Plated - Classification 900 MPa (At Ambient Te.pdf EN 2809-2001 en Aerospace Series - Nuts Hexagon Slotted Castellated Reduced Height Normal Across Flats in Heat Resisting Steel Silver Plated - Classification 900 MPa (At Ambient Te.pdf
  • EN 2810-2001 en Aerospace Series - Nuts Hexagon Slotted Castellated Reduced Height Normal Across Flats in Heat Resisting Steel Passivated - Classification 900 MPa (At Ambient Tempe.pdf EN 2810-2001 en Aerospace Series - Nuts Hexagon Slotted Castellated Reduced Height Normal Across Flats in Heat Resisting Steel Passivated - Classification 900 MPa (At Ambient Tempe.pdf
  • EN 2811-2016 en Aerospace series - Nuts hexagon slotted castellated in steel cadmium plated - Classification 1 100 MPa 235 《航空航天系列-钢镀镉的六角开槽齿形头螺母-等级 1100MPa 235℃》.pdf EN 2811-2016 en Aerospace series - Nuts hexagon slotted castellated in steel cadmium plated - Classification 1 100 MPa 235 《航空航天系列-钢镀镉的六角开槽齿形头螺母-等级 1100MPa 235℃》.pdf
  • EN 2812-2009 en Aerospace series - Stripping of electric cable《航空航天系列 电缆剥离工具》.pdf EN 2812-2009 en Aerospace series - Stripping of electric cable《航空航天系列 电缆剥离工具》.pdf
  • EN 2815-2009 en Aerospace series - Steel FE-PM1802 (X5CrNiCu15-5) - Consumable electrode remelted - Solution treated and precipitation treated - Bar for machining - a or D Less tha.pdf EN 2815-2009 en Aerospace series - Steel FE-PM1802 (X5CrNiCu15-5) - Consumable electrode remelted - Solution treated and precipitation treated - Bar for machining - a or D Less tha.pdf
  • EN 2817-2009 en Aerospace series - Steel FE-PM1802 (X5CrNiCu15-5) - Consumable electrode remelted - Solution treated and precipitation treated - Bar for machining - a or D Less tha.pdf EN 2817-2009 en Aerospace series - Steel FE-PM1802 (X5CrNiCu15-5) - Consumable electrode remelted - Solution treated and precipitation treated - Bar for machining - a or D Less tha.pdf
  • 相关搜索

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

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