第一范文网 - 专业文章范例文档资料分享平台

软件测试技术实验报告

来源:用户分享 时间:2025/5/26 1:10:01 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

《软件测试技术》

实验报告

河北工业大学计算机科学与软件学院

2017年9月

0

软件说明

电话号码问题

某城市电话号码由三部分组成。它们的名称和内容分别是: 地区码:空白或三位数字; 前 缀:非'0'或'1'的三位数字; 后 缀:4位数字。 流程图

源代码

import java.awt.*;

import java.awt.event.*;

public class PhoneNumber extends Frame implements ActionListener{ /** * */ private static final long serialVersionUID = 1L;

1

private final String[] st = {\static int c_person=0;

TextField t_name,t_local,t_prefix,t_suffix; RecordDialog d_record; MessageDialog d_message; person a[]=new person[100];

public PhoneNumber() { super(\电话号码\ this.setSize(250,250); this.setLocation(300,240); Panel panel1 = new Panel(new GridLayout(4, 1)); for (int i = 0; i < st.length; i++) panel1.add(new Label(st[i],0)); Panel panel2 = new Panel(new GridLayout(4, 1)); t_name =new TextField(\ t_local =new TextField(\ t_prefix=new TextField(\ t_suffix=new TextField(\ panel2.add(t_name); panel2.add(t_local); panel2.add(t_prefix); panel2.add(t_suffix); Panel panel3 = new Panel(new FlowLayout()); Button b_save = new Button(\ Button b_record= new Button(\ panel3.add(b_save); panel3.add(b_record); this.setLayout(new BorderLayout()); this.add(\ this.add(\ this.add(\ addWindowListener(new WindowCloser()); b_save.addActionListener(this); b_record.addActionListener(this); d_record=new RecordDialog(this); d_message=new MessageDialog(this); this.setVisible(true);

2

}

private class RecordDialog extends Dialog{ private static final long serialVersionUID = 1L; Frame frame; //对话框所依赖的框架窗口 TextArea t_show; RecordDialog(Frame frame){ super(frame,\记录\ this.frame=frame; this.setSize(300, 80); t_show=new TextArea(20,20); this.add(t_show); this.addWindowListener(new WindowCloser()); } public void show(String s) { t_show.setText(s); this.setLocation(frame.getX()+100, frame.getY()+100); this.setVisible(true); } }

private class MessageDialog extends Dialog { /** * */ private static final long serialVersionUID = 1L; Frame frame; //对话框所依赖的框架窗口 Label label; //对话框中显示信息 MessageDialog(Frame frame) { super(frame,\消息\ this.frame=frame; this.setSize(300, 80); label=new Label(\ this.add(label); this.addWindowListener(new WindowCloser()); } public void show(String string) { label.setText(string); this.setLocation(frame.getX()+100, frame.getY()+100); this.setVisible(true); }

3

搜索更多关于: 软件测试技术实验报告 的文档
软件测试技术实验报告.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c0zb6h9vyss0daes3y3831emx02sb8q00vq3_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top