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

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

1、计算机二级 JAVA-139 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、简单应用题(总题数:3,分数:100.00)1.本程序用下拉菜单来选择文本的字体。窗口中有一个文字标签和一个下拉菜单,下拉菜单中有三种字体:“宋体”、“楷体”和“黑体”,任选一种字体,文字标签中的文本就会变成菜单项对应的字体,如图所示。 (分数:30.00)_2.本程序中的窗口有一个按钮“得到最新日期”和三个文本框:“年”、“月”和“日”,单击“得到最新日期”按钮后,对应的文本框显示当前的年、月、日信息,如图所示。 (分数:30.00)_3.本程序监听鼠标用窗口的进出和点击情况,并将这些信息打印出来。

2、当输入移进窗口后台就打印出“Entered”,当鼠标移出窗口,后台就打印出“Exited”,当鼠标按下时,后台就打印出“Pressed”,当鼠标松开时,后台就打印出“Released”和“Clicked”。 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class exam_26 extends Frame _ public static void main (String args) exam_26 f=new exam_26(“exam_26“); Panel pan=new Panel()

3、 f.init(); public exam_26(String str) super(str); public void init() addWindowListener (new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); setSize(200,200); setLayout (new FlowLayout(); _; setVisible(true); public void mouseClicked(MouseEvent e) System.out.println(“Clic

4、ked“); public void mousePressed(MouseEvent e) System.out.println(“Pressed“); public void mouseReleased(MouseEvent e) System.out.println(“Released“); public void mouseEntered(MouseEvent e) System.out.println(“Entered“); public void mouseExited(MouseEvent e) System.out.println(“Exited“); (分数:40.00)_计算

5、机二级 JAVA-139 (1)答案解析(总分:100.00,做题时间:90 分钟)一、简单应用题(总题数:3,分数:100.00)1.本程序用下拉菜单来选择文本的字体。窗口中有一个文字标签和一个下拉菜单,下拉菜单中有三种字体:“宋体”、“楷体”和“黑体”,任选一种字体,文字标签中的文本就会变成菜单项对应的字体,如图所示。 (分数:30.00)_正确答案:()解析:第 1 处:new ItemListener() 第 2 处:getSelectedObjects()2.本程序中的窗口有一个按钮“得到最新日期”和三个文本框:“年”、“月”和“日”,单击“得到最新日期”按钮后,对应的文本框显示当前

6、的年、月、日信息,如图所示。 (分数:30.00)_正确答案:()解析:第 1 处:new Date() 第 2 处:da.getDay()+13.本程序监听鼠标用窗口的进出和点击情况,并将这些信息打印出来。当输入移进窗口后台就打印出“Entered”,当鼠标移出窗口,后台就打印出“Exited”,当鼠标按下时,后台就打印出“Pressed”,当鼠标松开时,后台就打印出“Released”和“Clicked”。 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class exam_26 exten

7、ds Frame _ public static void main (String args) exam_26 f=new exam_26(“exam_26“); Panel pan=new Panel(); f.init(); public exam_26(String str) super(str); public void init() addWindowListener (new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); setSize(200,200); setLayout

8、 (new FlowLayout(); _; setVisible(true); public void mouseClicked(MouseEvent e) System.out.println(“Clicked“); public void mousePressed(MouseEvent e) System.out.println(“Pressed“); public void mouseReleased(MouseEvent e) System.out.println(“Released“); public void mouseEntered(MouseEvent e) System.out.println(“Entered“); public void mouseExited(MouseEvent e) System.out.println(“Exited“); (分数:40.00)_正确答案:()解析:第 1 处:implements MouseListener 第 2 处:addMouseListener(this)

展开阅读全文
相关资源
猜你喜欢
  • GOST 8 135-2004 State system for ensuring the uniformity of measurements Weight amouhts of the standard materials for preparation of the buffer solutions - operational pH standardshe m.pdf GOST 8 135-2004 State system for ensuring the uniformity of measurements Weight amouhts of the standard materials for preparation of the buffer solutions - operational pH standardshe m.pdf
  • GOST 8 136-1974 State system for ensuring the uniformity of measurements Hydraulic presses for testing building materials Verification methods and means《ГСИ 液压式建材试验压力机 检定方法与工具》.pdf GOST 8 136-1974 State system for ensuring the uniformity of measurements Hydraulic presses for testing building materials Verification methods and means《ГСИ 液压式建材试验压力机 检定方法与工具》.pdf
  • GOST 8 137-1984 State system for ensuring the uniformity measurements State special standard and all-union verification schedule for means measuring acceleration in shock motion《国家.pdf GOST 8 137-1984 State system for ensuring the uniformity measurements State special standard and all-union verification schedule for means measuring acceleration in shock motion《国家.pdf
  • GOST 8 140-2009 State system for ensuring the uniformity of measurements State verification schedule for means of measuring heat conduction of solids in the range from 0 02 to 20 W.pdf GOST 8 140-2009 State system for ensuring the uniformity of measurements State verification schedule for means of measuring heat conduction of solids in the range from 0 02 to 20 W.pdf
  • GOST 8 141-1975 State system for ensuring the uniformity of measurements State primary standard and all-union verification schedule for means measuring specific heat of solid bodie0 K《.pdf GOST 8 141-1975 State system for ensuring the uniformity of measurements State primary standard and all-union verification schedule for means measuring specific heat of solid bodie0 K《.pdf
  • GOST 8 144-1997 State system for ensuring the uniformity of measurements State verification schedule for measuring means of magnetic induction of state magnetic fields within the r.pdf GOST 8 144-1997 State system for ensuring the uniformity of measurements State verification schedule for measuring means of magnetic induction of state magnetic fields within the r.pdf
  • GOST 8 145-1975 State system for ensuring the uniformity of measurements State primary standard and all-union verification schedule for means measuring volumetric flow of liquids wto 1.pdf GOST 8 145-1975 State system for ensuring the uniformity of measurements State primary standard and all-union verification schedule for means measuring volumetric flow of liquids wto 1.pdf
  • GOST 8 146-1975 State system for ensuring the uniformity of measurements Indicating and recording pressure gauge with integrator of SSI Methods of verification《国家测量统一性保证体系 SSI积分指示压.pdf GOST 8 146-1975 State system for ensuring the uniformity of measurements Indicating and recording pressure gauge with integrator of SSI Methods of verification《国家测量统一性保证体系 SSI积分指示压.pdf
  • GOST 8 147-1975 State system for ensuring the uniformity of measurements Measurement tool CC type for gear whell runout Verification methods and means《国家测量统一性保证体系 SC型齿轮跳动测量工具 鉴定方法及.pdf GOST 8 147-1975 State system for ensuring the uniformity of measurements Measurement tool CC type for gear whell runout Verification methods and means《国家测量统一性保证体系 SC型齿轮跳动测量工具 鉴定方法及.pdf
  • 相关搜索

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

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