资源简介

图书管理系统 北邮 大三上学期 面向对象的分析与设计(Java) 语言:Java 图形化界面:Swing 功能: 运用工厂模式、观察者模式、策略模式、组合模式和单子模式等设计模式 完善的类继承和组合关系 包含添加库存、图书订购、折扣策略管理等功能

资源截图

代码片段和文件信息

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

/**
 * Created by Hongzhilong on 16/1/4.
 */
public class _13211415_洪志龙_7_AddBookUI extends Jframe implements ActionListener {
    private _13211415_洪志龙_7_Controller controller;

    private JTextField textFieldPrice = new JTextField();
    private JTextField textFieldtitle = new JTextField();
    private JTextField textFieldISDN = new JTextField();
    private JComboBox comboBoxType = new JComboBox();
    private JButton buttonOk = new JButton(“确定“);
    private JButton buttonClear = new JButton(“清空“);

    _13211415_洪志龙_7_AddBookUI(_13211415_洪志龙_7_Controller controller){
        this.controller=controller;

        GridLayout grid=new GridLayout(52);
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(grid);
        mainPanel.add(new JLabel(“书名:“));
        mainPanel.add(textFieldtitle);
        mainPanel.add(new JLabel(“ISBN:“));
        mainPanel.add(textFieldISDN);
        mainPanel.add(new JLabel(“价格:“));
        mainPanel.add(textFieldPrice);
        mainPanel.add(new JLabel(“类型:“));
        mainPanel.add(comboBoxType);
        mainPanel.add(buttonOk);
        mainPanel.add(buttonClear);
        comboBoxType.addItem(“非教材类计算机图书“);
        comboBoxType.addItem(“教材类图书“);
        comboBoxType.addItem(“连环画类图书“);
        comboBoxType.addItem(“养生类图书“);
        comboBoxType.addItem(“其他“);
        pack();

        textFieldPrice.addKeyListener(new KeyAdapter(){
            public void keyTyped(KeyEvent e) {
                int keyChar = e.getKeyChar();
                if(keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9 || keyChar == KeyEvent.VK_PERIOD){
                }
                else{
                    e.consume();
                }
            }
        });

        textFieldISDN.addKeyListener(new KeyAdapter(){
            public void keyTyped(KeyEvent e) {
                int keyChar = e.getKeyChar();
                if(keyChar >= KeyEvent.VK_0 && keyChar <= KeyEvent.VK_9 || keyChar == KeyEvent.VK_MINUS){
                }
                else{
                    e.consume();
                }
            }
        });

        buttonOk.addActionListener(this);
        buttonClear.addActionListener(this);

        add(mainPanel);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        int screenHeight = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height;
        int screenWidth = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;
        settitle(“添加书籍信息“);
        setResizable(false);
        setSize(300 200);
        setLocation((screenWidth - 300) / 2 (screenHeight - 200) / 2);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent e) {
        if(e.getSource()==buttonOk){
            if(text

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-09 01:31  Book Store\
     目录           0  2018-01-09 01:31  Book Store\.idea\
     文件           9  2017-12-04 21:11  Book Store\.idea\.name
     文件         405  2017-12-04 21:11  Book Store\.idea\codestyleSettings.xml
     文件         707  2017-12-04 21:11  Book Store\.idea\compiler.xml
     目录           0  2018-01-09 01:31  Book Store\.idea\copyright\
     文件          76  2017-12-04 21:11  Book Store\.idea\copyright\profiles_settings.xml
     目录           0  2018-01-09 01:31  Book Store\.idea\dictionaries\
     文件          88  2017-12-04 21:11  Book Store\.idea\dictionaries\Bonjour.xml
     文件         164  2017-12-04 21:11  Book Store\.idea\encodings.xml
     文件         891  2017-12-04 21:11  Book Store\.idea\misc.xml
     文件         265  2017-12-04 21:11  Book Store\.idea\modules.xml
     文件        8915  2017-12-04 21:11  Book Store\.idea\uiDesigner.xml
     文件       82949  2017-12-04 21:11  Book Store\.idea\workspace.xml
     文件       13184  2017-12-04 21:11  Book Store\classes.uml
     文件      198010  2017-12-04 21:11  Book Store\diagram.png
     文件         433  2017-12-04 21:11  Book Store\homework7.iml
     目录           0  2018-01-09 01:31  Book Store\out\
     目录           0  2018-01-09 01:31  Book Store\out\production\
     目录           0  2018-01-09 01:31  Book Store\out\production\homework7\
     文件         904  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_AddBookUI$1.class
     文件         904  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_AddBookUI$2.class
     文件        4673  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_AddBookUI.class
     文件        1436  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_BookCatalog.class
     文件        1013  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_BookSpecification.class
     文件        1220  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_BookType.class
     文件         891  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_BuyUI$1.class
     文件        3714  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_BuyUI.class
     文件        1140  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_CompositeBestForCustomer.class
     文件        2012  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_CompositeStrategy.class
     文件        9124  2017-12-04 21:11  Book Store\out\production\homework7\_13211415_洪志龙_7_Controller.class
............此处省略50个文件信息

评论

共有 条评论