软件的测试技术实验报告材料

上传人:cn****1 文档编号:489899178 上传时间:2022-10-22 格式:DOC 页数:37 大小:2.27MB
返回 下载 相关 举报
软件的测试技术实验报告材料_第1页
第1页 / 共37页
软件的测试技术实验报告材料_第2页
第2页 / 共37页
软件的测试技术实验报告材料_第3页
第3页 / 共37页
软件的测试技术实验报告材料_第4页
第4页 / 共37页
软件的测试技术实验报告材料_第5页
第5页 / 共37页
点击查看更多>>
资源描述

《软件的测试技术实验报告材料》由会员分享,可在线阅读,更多相关《软件的测试技术实验报告材料(37页珍藏版)》请在金锄头文库上搜索。

1、软件测试技术实验报告某某工业大学计算机科学与软件学院2017年9月软件说明问题某城市由三局部组成。它们的名称和内容分别是: 地区码:空白或三位数字; 前 缀:非0或1的三位数字; 后 缀:4位数字。流程图源代码public class PhoneNumber extends Frame implements ActionListener/* * */private static final long serialVersionUID = 1L;private final String st = Name,Local,Prefix,Suffix;static int c_person=0;Tex

2、tField t_name,t_local,t_prefix,t_suffix;RecordDialog d_record;MessageDialog d_message;person a=new person100;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(sti,0);Panel p

3、anel2 = new Panel(new GridLayout(4, 1);t_name =new TextField(,20);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(Save); B

4、utton b_record= new Button(Record);panel3.add(b_save);panel3.add(b_record);this.setLayout(new BorderLayout();this.add(West, panel1);this.add(East, panel2);this.add(South, panel3);addWindowListener(new WindowCloser();b_save.addActionListener(this);b_record.addActionListener(this);d_record=new RecordD

5、ialog(this);d_message=new MessageDialog(this);this.setVisible(true);private class RecordDialog extends Dialogprivate static final long serialVersionUID = 1L;Frame frame; /对话框所依赖的框架窗口TextArea t_show;RecordDialog(Frame frame)super(frame,记录,true);this.frame=frame;this.setSize(300, 80);t_show=new TextAr

6、ea(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; /

7、对话框所依赖的框架窗口Label label; /对话框中显示信息MessageDialog(Frame frame)super(frame,消息,true);this.frame=frame;this.setSize(300, 80);label=new Label(,Label.CENTER);this.add(label);this.addWindowListener(new WindowCloser();public void show(String string) label.setText(string);this.setLocation(frame.getX()+100, fra

8、me.getY()+100);this.setVisible(true);private class WindowCloser extends WindowAdapterpublic void windowClosing(WindowEvent we)Window label = we.getWindow();label.setVisible(false);private class personString name,local,prefix,suffix;person(String name,String local,String prefix,String suffix)this.nam

9、e=name;this.local=local;this.prefix=prefix;this.suffix=suffix;public String getname()return name;public String getlocal()return local;public String getprefix()return prefix;public String getsuffix()return suffix;public String toString()return this.getname()+t+this.getlocal()+t+this.getprefix()+t+thi

10、s.getsuffix()+n;public boolean check(String local,String prefix,String suffix) if(local.equals()|(local.length()=3&local.matches(0-9+) &(prefix.length()=3&prefix.matches(2-9+) &(suffix.length()=4&suffix.matches(0-9+) return true; return false;public void actionPerformed(ActionEvent e) String label =

11、 e.getActionmand();if(label=Save)String name=t_name.getText();String local=t_local.getText();String suffix=t_suffix.getText();String prefix=t_prefix.getText();if(check(local,prefix,suffix)ac_person=new person(name,local,prefix,suffix);c_person+;elseString message=;if(!local.equals()&(local.length()!

12、=3|!local.matches(0-9+)message+=local is error,;if(prefix.length()!=3|!prefix.matches(2-9+)message+=prefix is error,;if(suffix.length()!=4|!suffix.matches(0-9+)message+=suffix is error;message+=please input again.;d_message.show(message);t_name.setText();t_local.setText();t_prefix.setText();t_suffix.setText();if(label=Record)d_record.show(this.toshow();public String toshow()String s=nametlocaltprefixtsuffixn;for(int i=0;ic_person;i+)s+=ai.toString();return s;public static void main(String arg)new PhoneNumber();界面使用说明: na

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 医学/心理学 > 基础医学

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号