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

📄 magazinelogoutpanel.java

📁 一个功能强大的图书管理系统,是个人版,适合学习swing的初学者阅读.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        btnReset2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        btnReset2.setForeground(Color.blue);
        btnReset2.setText("数据重置");

        jScrollPane2.setBorder(BorderFactory.createLineBorder(Color.black));
        jScrollPane2.setBounds(new Rectangle(97, 144, 537, 54));
        jtxLogOut.setBounds(2, 2, jScrollPane2.getWidth() - 10,
                            jScrollPane2.getHeight() - 10);
        jtxLogOut.setFont(new java.awt.Font("宋体", Font.PLAIN, 16));
        jtxLogOut.setForeground(Color.red);
        jtxLogOut.setBorder(BorderFactory.createEtchedBorder());
        jtxLogOut.setToolTipText("");
        jtxLogOut.setMargin(new Insets(10, 10, 10, 10));
        jtxLogOut.setText("必添");
        jtxLogOut.setLineWrap(true);
        jLabel2.setFont(new java.awt.Font("宋体", Font.BOLD, 16));
        jLabel2.setForeground(Color.red);
        jLabel2.setText("注销原因");
        jLabel2.setBounds(new Rectangle(24, 150, 71, 27));
        jScright.addComponentListener(new
                                      MagazineLogOutPanel_jScright_componentAdapter(this));
        jScright.addHierarchyBoundsListener(new
                                            MagazineLogOutPanel_jScright_hierarchyBoundsAdapter(this));
        jPanRight.addHierarchyBoundsListener(new
                                             MagazineLogOutPanel_jPanRight_hierarchyBoundsAdapter(this));

        jSpSystemPanel.add(jScleft, JSplitPane.LEFT);
        jScleft.getViewport().add(jTreeQikan);
        jSpSystemPanel.add(jScright, JSplitPane.RIGHT);
        jScright.getViewport().add(jPanRight);
        jPanRight.add(jPaneRightBottom);
        jPaneRightBottom.add(jTpRightBottom);
        jPanRight.add(jPanelRightTop);
        jTpRightBottom.add(jTpRightBottomPanel2, "期刊注销业务   ");
        jPanelRightTop.add(jPanelRightTopjPanel);
        jPanelRightTopjPanel.add(jlbM);
        jPanelRightTop.add(jScrollPane1);
        jScrollPane1.getViewport().add(jTeaRightTop2);
        jTpRightBottomPanel2.add(jLabel18);
        jTpRightBottomPanel2.add(jtxBookName2);
        jTpRightBottomPanel2.add(jLabel16);
        jTpRightBottomPanel2.add(jtxBookNum2);
        jTpRightBottomPanel2.add(jLabel12);
        jTpRightBottomPanel2.add(jtxBookAuthor2);
        jTpRightBottomPanel2.add(jLabel13);
        jTpRightBottomPanel2.add(jtxBookLanguage2);
        jTpRightBottomPanel2.add(jLabel17);
        jTpRightBottomPanel2.add(jtxBookBorrowMoneyNum2);
        jTpRightBottomPanel2.add(jLabel2);
        jTpRightBottomPanel2.add(btnReset2);
        jTpRightBottomPanel2.add(btnQueRen2);
        jTpRightBottomPanel2.add(jScrollPane2);
        jTpRightBottomPanel2.add(jtxBookStation2);
        jTpRightBottomPanel2.add(jtxBookType2);
        jTpRightBottomPanel2.add(jLabel21);
        jTpRightBottomPanel2.add(jLabel20);
        jTpRightBottomPanel2.add(jtxBookConcern2);
        jTpRightBottomPanel2.add(jtxBookPurchaseMoney2);
        jTpRightBottomPanel2.add(jLabel19);
        jTpRightBottomPanel2.add(jLabel15);
        jTpRightBottomPanel2.add(jLabel14);
        jTpRightBottomPanel2.add(jtxBookBeginHandlers2);
        jScrollPane2.getViewport().add(jtxLogOut);
        this.add(jSpSystemPanel);
        // jPanelRightTopjPanel
    }

    public void loginTree() {
        ResultSet re = null;
        DefaultMutableTreeNode magazinetypeFather[];
        DefaultMutableTreeNode magazinetypeChilkl[];
        int size = 0;
        int j = 0;
        int i = 0;
        //连接数据库
        //  if (db.getconn()) {
        //获得结果集
        re = db.searchMagazinTree();

        try {
            while (re.next()) {
                size++;
            }
            magazinetypeFather = new DefaultMutableTreeNode[size];
            magazinetypeChilkl = new DefaultMutableTreeNode[size];
            boolean a = re.first();
            String TypeFather = "";
            String TypeChild = "";
            for (i = 0, j = 0; a; i++) {
                String TypeFather1 = re.getString(2).trim();
                String TypeChild1 = re.getString(3).trim();
                if (!TypeFather.trim().equals(TypeFather1)) {
                    TypeFather = TypeFather1;
                    magazinetypeFather[j] = new DefaultMutableTreeNode(
                            TypeFather);
                    qikan.add(magazinetypeFather[j]);
                    j++;
                }
                magazinetypeChilkl[i] = new DefaultMutableTreeNode(TypeChild1);
                magazinetypeFather[j - 1].add(magazinetypeChilkl[i]);
                a = re.next();
            }
            jTreeQikan.updateUI();
        } catch (SQLException ex) {
            System.out.println(ex.toString());
        }
        db.myClose(1);
    }


    public void this_ancestorResized(HierarchyEvent e) {
        jSpSystemPanel.setSize(this.getWidth() - 5, this.getHeight());
        jSpSystemPanel.setDividerLocation(0.21);
    }

    public void jScright_ancestorResized(HierarchyEvent e) {
        jPanRight.setSize((jScright.getWidth() - 1), (jScright.getHeight() - 1));
    }

    public void jPanRight_ancestorResized(HierarchyEvent e) {
        jPanelRightTopjPanel.setSize((jPanelRightTop.getWidth() - 2), 25);
        jPanelRightTop.setBounds(jPaneRightBottom.getX() + 1,
                                 (jPaneRightBottom.getY() +
                                  jPaneRightBottom.getHeight() - 1),
                                 (jPanRight.getWidth()) - 5,
                                 (jPanRight.getHeight() * 3 / 7 - 1));
        jScrollPane1.setBounds(1, 25, (jPanelRightTop.getWidth()) - 1,
                               (jPanelRightTop.getHeight()) - 25);
        jlbM.setBounds(5, 2, jPanelRightTopjPanel.getWidth() - 10, 20);
        jPaneRightBottom.setSize((jPanRight.getWidth()) - 5,
                                 (jPanRight.getHeight()) * 4 / 7 - 2);

    }


    public void jScright_componentResized(ComponentEvent e) {

        jPanRight.setSize((jScright.getWidth() - 2), (jScright.getHeight() - 1));
    }

    public void jPaneRightBottom_componentResized(ComponentEvent e) {
        jTpRightBottom.setSize(jPaneRightBottom.getWidth() - 2,
                               jPaneRightBottom.getHeight() - 1);
    }

    public void jTreBooks_mouseClicked(MouseEvent e) {
        display();

    }
    public void tableDisp(String sql)
       {
           String[][] data;
           ResultSet rs;
           try {
               rs = db.booksInfosearch(sql);

               int count = 0;
               while (rs.next())
                   count++;
               rs.first();
               data = new String[count][title.length];
               for (int i = 0; i < count; i++) {
                   for (int j = 0; j < title.length; j++) {
                       String s = "";
                       if (j == 8)
                           s = (new Float(rs.getFloat(j + 2))).toString().trim() +
                               "元";
                       else
                           s = rs.getString(j + 2);
                       if (s == null)
                           s = "null";
                       data[i][j] = s.trim();
                   }
                   rs.next();
               }
               DefaultTableModel model = new DefaultTableModel(data, title);
               jTeaRightTop2.setModel(model);
               jTeaRightTop2.updateUI();
               db.myClose(1);

           }

           catch (SQLException sex) {
               System.out.println(sex.toString());
               // sex.printStackTrace();
           }
           db.myClose(1);
       }

    public void display() {
        DefaultMutableTreeNode clickNode = (DefaultMutableTreeNode) jTreeQikan.
                                           getLastSelectedPathComponent();
        String sql = "";
        String sql2 = "";
        String bti = "";
        //数据库表没有见
        if (clickNode != null) {

            //查询条件许转换
            if (clickNode.toString().trim().equals("所有期刊")) {
                bti = "%";
            } else {
                sql = "select TypeID from typechaxun where magazinTypeName='" +
                      clickNode.toString().trim() + "'";
                sql2 = "select TypeID1 from typechaxun where typeName='" +
                       clickNode.toString().trim() + "'";

                db.search(sql);
                try {
                    if (db.rs.next())
                        bti = db.rs.getString(1).trim();
                    else {
                        db.myClose(1);
                        db.search(sql2);
                        if (db.rs.next())
                            bti = db.rs.getString(1).trim();
                    }
                } catch (SQLException ex) {
                    System.out.println(ex.toString());
                }
                db.myClose(1);
            }
            sql = "select * from magazineInfo where typenumbers like'" +
                  bti.trim() + "'+'%'";

            jlbM.setText(clickNode.toString().trim() + "类 期刊信息列表");
            jtxBookType2.setText(clickNode.toString().trim());
            //  jtxBookType2.setText(clickNode.toString().trim());
            fenlei = clickNode.toString().trim();
            tableDisp(sql);
        }

    }


    public void jtxBookNum2_mouseClicked(MouseEvent e) {
        inputBooksNum(jtxBookNum2);
    }

    public void inputBooksNum(JTextField a) {
        String bianhao = "";
        try {
            bianhao = JOptionPane.showInputDialog(null, "请输入需要增加期刊的编号    例如 ",
                                                  "W00020070800000001").trim();
        } catch (Exception ex) {
            // JOptionPane.showMessageDialog(null, "你没有输入读者信息");
        }

        if (!bianhao.equals("")) {
            if ((int) bianhao.charAt(0) >= 'A' &&

⌨️ 快捷键说明

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