java全球通计费程序

上传人:206****923 文档编号:91848849 上传时间:2019-07-02 格式:DOC 页数:14 大小:140.52KB
返回 下载 相关 举报
java全球通计费程序_第1页
第1页 / 共14页
java全球通计费程序_第2页
第2页 / 共14页
java全球通计费程序_第3页
第3页 / 共14页
java全球通计费程序_第4页
第4页 / 共14页
java全球通计费程序_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《java全球通计费程序》由会员分享,可在线阅读,更多相关《java全球通计费程序(14页珍藏版)》请在金锄头文库上搜索。

1、1 设计时间 2011年6月6日2011年6月10日2 设计目的课程设计是全面的综合练习。通过实践加深了对面向对象程序设计的理论、方法和基础知识的理解,掌握运用Java语言进行面向对象设计的基本方法,提高运用面向对象知识分析实际问题、解决实际问题的能力,提高我们的应用能力。3设计任务使用图形用户界面,使用真实的全球通资费标准,模拟统计一个特定号的一个月的实时话费。能根据输入实现各种用户的话费的计算并显示月实时账单。(使用接口和多个子类实现分别表示金卡、银卡等各种套餐的话费计算)4 设计内容 输入界面4.1 概要设计如图进入查询主界面 输出界面输入界面输出界面输入界面输入界面进入选择界面 点击

2、选择金卡 选择银卡 输入帐号和密码 输入帐号和密码 图1.0 4.2 程序代码 import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.awt.event.ActionEvent;public class QuanQiuTong1 extends Frame private static final long serialVersionUID = -687904501047398950L;Button b=new Button(欢迎来到全球通话费查询系统点击进入); public QuanQiu

3、Tong () this.setTitle(全球通话费查询系统); this.setLayout(new BorderLayout(); this.add(b); b.setForeground(Color.red); b.addActionListener(new MyListener1(); this.setBounds(100,200,300,300); b.setBackground(Color.green); this.setVisible(true); public static void main(String args) new QuanQiuTong1(); class My

4、Listener1 implements ActionListener public void actionPerformed(ActionEvent e) new ZhongLei(); class ZhongLei extends Frame private static final long serialVersionUID = 8766071926133806787L;private JRadioButton r1=new JRadioButton(金卡); private JRadioButton r2=new JRadioButton(银卡); private Panel p0=n

5、ew Panel(); private Label l0=new Label(请选择你使用的卡的种类); private Panel p1=new Panel(); public ZhongLei () l0.setForeground(Color.red); this.setTitle(选卡窗口); this.setLayout(new GridLayout(2,1); p0.add(l0); p1.add(r1); r1.setSelected(false); r1.addActionListener(new MyListener11(); p1.add(r2); r2.setSelect

6、ed(false); r2.addActionListener(new MyListener11(); this.add(p0); this.add(p1); this.setBounds(300,200,250,250); this.setBackground(Color.green); this.setVisible(true); public static void main(String args) new ZhongLei(); class MyListener11 implements ActionListener public void actionPerformed(Actio

7、nEvent e) if(r1.isSelected() new JinKa(); if(r2.isSelected() new YinKa(); class JinKa extends Frame private static final long serialVersionUID = -7904065589243691833L; private Label l1=new Label(欢迎查询金卡费用); private Label l2=new Label(卡号:); private Label l3=new Label(密码:); private Panel p0=new Panel()

8、; private Panel p1=new Panel(); private Panel p2=new Panel(); private Panel p3=new Panel(); private Button b=new Button(查询); private TextField t1=new TextField(11); private TextField t2=new TextField(11); public JinKa() l1.setForeground(Color.yellow); this.setTitle(金卡); this.setLayout(new GridLayout

9、(4,1); this.setBounds(550,200,250,250); p1.add(l2);p2.add(l3); p0.add(l1);p1.add(t1);p2.add(t2);p3.add(b); t1.addActionListener(new MTextField1(); t2.addActionListener(new MTextField2(); t2.setEchoChar(*); b.addActionListener(new JinKa1(); this.add(p0);this.add(p1);this.add(p2);this.add(p3); this.se

10、tBackground(Color.green); this.setVisible(true); public static void main(String args) new JinKa(); class YinKa extends Frame private static final long serialVersionUID = -2696746332725644863L;private Label l1=new Label(欢迎查询银卡费用); private Label l2=new Label(卡号:); private Label l3=new Label(密码:); priv

11、ate Panel p0=new Panel(); private Panel p1=new Panel(); private Panel p2=new Panel(); private Panel p3=new Panel(); private Button b=new Button(查询); private TextField t1=new TextField(11); private TextField t2=new TextField(11); public YinKa() l1.setForeground(Color.red); this.setTitle(银卡); this.setLayout(new GridLayout(4,1); this.setBounds(550,200,250,250); p1.add(l2);p2.add(l3);

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

当前位置:首页 > 中学教育 > 其它中学文档

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