⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fralibfind.java~16~

📁 用java实现的一个应用程序,源码非常完整,可以直接运行
💻 JAVA~16~
字号:
package 毕业设计;

import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.*;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentAdapter;

public class fraLibFind extends JFrame {
    JLabel lblId = new JLabel();
    JTextField txtId = new JTextField();
    JLabel lblBarCode = new JLabel();
    JTextField txtBarCode = new JTextField();
    JLabel lblName = new JLabel();
    JTextField txtName = new JTextField();
    JLabel lblAuthor = new JLabel();
    JTextField txtAuthor = new JTextField();
    JLabel lblSynopsis = new JLabel();
    JLabel lblPublish = new JLabel();
    JLabel lblPrice = new JLabel();
    JLabel lblSort = new JLabel();
    JLabel lblIntoTime = new JLabel();
    JLabel lblLocation = new JLabel();
    JTextField txtPrice = new JTextField();
    JTextField txtIntoTime = new JTextField();
    JLabel lblIsbn = new JLabel();
    JTextField txtIsbn = new JTextField();
    JTextField txtLocation = new JTextField();
    JButton btnFind = new JButton();
    JButton btnCancel = new JButton();
    JButton btnExit = new JButton();
    JLabel lblLine = new JLabel();
    JLabel lblPage = new JLabel();
    JTextField txtPage = new JTextField();
    JLabel lblFindId = new JLabel();
    JTextField txtFindId = new JTextField();
    JLabel lblFindBarCode = new JLabel();
    JTextField txtFindBarCode = new JTextField();
    JLabel lblFindName = new JLabel();
    JTextField txtFindName = new JTextField();
    JLabel lblFindAuthor = new JLabel();
    JTextField txtFindAuthor = new JTextField();
    JLabel lblFindPublish = new JLabel();
    JTextField txtFindPublish = new JTextField();
    JLabel lblFindSort = new JLabel();
    JTextField txtFindSort = new JTextField();
    JRadioButton rbnExactSearch = new JRadioButton();
    JRadioButton rbnBlurrySearch = new JRadioButton();
    JTextField txtPublish = new JTextField();
    JTextField txtSort = new JTextField();
    JLabel lblIsin = new JLabel();
    JTextField txtIsin = new JTextField();
    JTextArea txtSynopsis = new JTextArea();
    JPanel pnlFind = new JPanel();
    JTable tblArray = new JTable();
    JLabel lblLibDisplay = new JLabel();

    public fraLibFind() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        setSize(new Dimension(800, 600));
        this.addComponentListener(new fraLibFind_this_componentAdapter(this));
        lblId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblId.setText("编      号:");
        lblId.setBounds(new Rectangle(334, 23, 56, 24));
        txtId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtId.setBounds(new Rectangle(391, 24, 156, 24));
        lblBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblBarCode.setText("条 形 码:");
        lblBarCode.setBounds(new Rectangle(334, 56, 51, 23));
        txtBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtBarCode.setText("");
        txtBarCode.setBounds(new Rectangle(392, 54, 156, 23));
        lblName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtName.setText("");
        txtName.setBounds(new Rectangle(393, 86, 155, 26));
        lblAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblAuthor.setText("作     者:");
        lblAuthor.setBounds(new Rectangle(332, 115, 51, 24));
        txtAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtAuthor.setText("");
        txtAuthor.setBounds(new Rectangle(393, 119, 153, 23));
        lblSynopsis.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblSynopsis.setText("简       介:");
        lblSynopsis.setBounds(new Rectangle(569, 117, 55, 22));
        lblName.setText("名     称:");
        lblName.setBounds(new Rectangle(334, 86, 50, 23));
        lblPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblPublish.setText("出 版 社:");
        lblPublish.setBounds(new Rectangle(333, 145, 55, 23));
        lblPrice.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblPrice.setText("价     格:");
        lblPrice.setBounds(new Rectangle(333, 207, 50, 19));
        lblSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblSort.setText("类       别:");
        lblSort.setBounds(new Rectangle(332, 264, 61, 22));
        lblIntoTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblIntoTime.setText("入库时间:");
        lblIntoTime.setBounds(new Rectangle(569, 56, 56, 26));
        lblLocation.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblLocation.setText("存放位置:");
        lblLocation.setBounds(new Rectangle(569, 84, 56, 28));
        txtPrice.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtPrice.setText("");
        txtPrice.setBounds(new Rectangle(393, 177, 153, 22));
        txtIntoTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtIntoTime.setText("");
        txtIntoTime.setBounds(new Rectangle(633, 56, 143, 25));
        lblIsbn.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblIsbn.setText("I S B N:");
        lblIsbn.setBounds(new Rectangle(333, 175, 50, 22));
        txtIsbn.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtIsbn.setText("");
        txtIsbn.setBounds(new Rectangle(393, 205, 155, 24));
        txtLocation.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtLocation.setText("");
        txtLocation.setBounds(new Rectangle(632, 87, 143, 25));
        btnFind.setBounds(new Rectangle(96, 234, 67, 27));
        btnFind.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        btnFind.setText("查询");
        btnCancel.setBounds(new Rectangle(168, 234, 66, 27));
        btnCancel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        btnCancel.setText("清空");
        btnExit.setBounds(new Rectangle(243, 234, 65, 28));
        btnExit.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        btnExit.setText("退出");
        lblLine.setBorder(BorderFactory.createEtchedBorder());
        lblLine.setText("");
        lblLine.setBounds(new Rectangle(14, 12, 774, 291));
        lblPage.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblPage.setText("总 页 数:");
        lblPage.setBounds(new Rectangle(333, 235, 54, 25));
        txtPage.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtPage.setText("");
        txtPage.setBounds(new Rectangle(392, 235, 156, 23));
        lblFindId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindId.setText("图书编号:");
        lblFindId.setBounds(new Rectangle(25, 23, 61, 26));
        txtFindId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindId.setText("");
        txtFindId.setBounds(new Rectangle(83, 25, 229, 24));
        lblFindBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindBarCode.setText("条 形 码:");
        lblFindBarCode.setBounds(new Rectangle(25, 61, 61, 21));
        txtFindBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindBarCode.setText("");
        txtFindBarCode.setBounds(new Rectangle(83, 58, 229, 25));
        lblFindName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindName.setText("图书名称:");
        lblFindName.setBounds(new Rectangle(23, 92, 63, 19));
        txtFindName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindName.setText("");
        txtFindName.setBounds(new Rectangle(83, 89, 229, 24));
        lblFindAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindAuthor.setText("图书作者:");
        lblFindAuthor.setBounds(new Rectangle(23, 118, 62, 22));
        txtFindAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindAuthor.setText("");
        txtFindAuthor.setBounds(new Rectangle(84, 118, 227, 24));
        lblFindPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindPublish.setText("出 版 社:");
        lblFindPublish.setBounds(new Rectangle(24, 146, 59, 22));
        txtFindPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindPublish.setText("");
        txtFindPublish.setBounds(new Rectangle(84, 148, 227, 23));
        lblFindSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblFindSort.setText("图书类别:");
        lblFindSort.setBounds(new Rectangle(23, 177, 62, 22));
        txtFindSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtFindSort.setText("");
        txtFindSort.setBounds(new Rectangle(84, 176, 227, 24));
        rbnExactSearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        rbnExactSearch.setText("精确查找");
        rbnExactSearch.setBounds(new Rectangle(19, 218, 75, 26));
        rbnBlurrySearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        rbnBlurrySearch.setText("模糊查找");
        rbnBlurrySearch.setBounds(new Rectangle(19, 246, 74, 27));
        txtPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtPublish.setText("");
        txtPublish.setBounds(new Rectangle(392, 148, 154, 21));
        txtSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtSort.setText("");
        txtSort.setBounds(new Rectangle(392, 266, 157, 23));
        lblIsin.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        lblIsin.setText("是否在库:");
        lblIsin.setBounds(new Rectangle(568, 22, 60, 24));
        txtIsin.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
        txtIsin.setText("");
        txtIsin.setBounds(new Rectangle(633, 21, 143, 26));
        txtSynopsis.setFont(new java.awt.Font("Dialog", Font.PLAIN, 11));
        txtSynopsis.setText("");
        txtSynopsis.setBounds(new Rectangle(571, 138, 206, 153));
        pnlFind.setBorder(null);
        pnlFind.setBounds(new Rectangle( -1, 0, 801, 309));
        pnlFind.setLayout(null);
        tblArray.setBounds(new Rectangle(13, 346, 773, 222));
        lblLibDisplay.setText("图书列表");
        lblLibDisplay.setBounds(new Rectangle(399, 305, 77, 20));
        pnlFind.add(lblFindId);
        pnlFind.add(txtFindId);
        pnlFind.add(txtFindBarCode);
        pnlFind.add(lblFindBarCode);
        pnlFind.add(lblFindName);
        pnlFind.add(txtFindName);
        pnlFind.add(lblFindAuthor);
        pnlFind.add(txtFindAuthor);
        pnlFind.add(txtFindPublish);
        pnlFind.add(lblFindSort);
        pnlFind.add(txtFindSort);
        pnlFind.add(txtId);
        pnlFind.add(txtLocation);
        pnlFind.add(txtIntoTime);
        pnlFind.add(lblIntoTime);
        pnlFind.add(lblLocation);
        pnlFind.add(txtBarCode);
        pnlFind.add(txtName);
        pnlFind.add(txtAuthor);
        pnlFind.add(txtPublish);
        pnlFind.add(txtPrice);
        pnlFind.add(txtIsbn);
        pnlFind.add(txtPage);
        pnlFind.add(lblId);
        pnlFind.add(lblBarCode);
        pnlFind.add(lblName);
        pnlFind.add(lblAuthor);
        pnlFind.add(lblPublish);
        pnlFind.add(lblIsbn);
        pnlFind.add(lblPrice);
        pnlFind.add(lblPage);
        pnlFind.add(lblFindPublish);
        pnlFind.add(lblSort);
        pnlFind.add(txtSort);
        pnlFind.add(txtIsin);
        pnlFind.add(lblIsin);
        pnlFind.add(lblSynopsis);
        pnlFind.add(txtSynopsis);
        pnlFind.add(btnFind);
        pnlFind.add(btnCancel);
        pnlFind.add(btnExit);
        pnlFind.add(rbnBlurrySearch);
        pnlFind.add(rbnExactSearch);
        pnlFind.add(lblLine);
        this.getContentPane().add(pnlFind);
        this.getContentPane().add(tblArray);
        this.getContentPane().add(lblLibDisplay);
    }
    public void ShowLibFind()
    {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension dlgSize = this.getSize();
        if (dlgSize.height > screenSize.height) {
            dlgSize.height = screenSize.height;
         }
        if (dlgSize.width > screenSize.width) {
            dlgSize.width = screenSize.width;
         }
        this.setLocation((screenSize.width - dlgSize.width) / 2,
                         (screenSize.height - dlgSize.height) / 2);
        this.setVisible(true);
    }


    public void this_componentResized(ComponentEvent e) {
          tblArray.setSize(this.getWidth()-35,this.getHeight()-35);
          pnlFind.setLocation((this.getWidth() - pnlFind.getWidth())/2,0);
          lblLibDisplay.setLocation((this.getWidth() - pnlFind.getWidth())/2,this.getHeight()/2);
    }
}


class fraLibFind_this_componentAdapter extends ComponentAdapter {
    private fraLibFind adaptee;
    fraLibFind_this_componentAdapter(fraLibFind adaptee) {
        this.adaptee = adaptee;
    }

    public void componentResized(ComponentEvent e) {
        adaptee.this_componentResized(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -