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

📄 readersystemchaxunpanel.java~30~

📁 一个功能强大的图书管理系统,是个人版,适合学习swing的初学者阅读.
💻 JAVA~30~
📖 第 1 页 / 共 3 页
字号:
       jPanelLeft1.setLayout(null);
       jLabel25.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
       jLabel25.setForeground(Color.blue);
       jLabel25.setText("读者类型");
       jLabel25.setBounds(new Rectangle(7, 43, 62, 30));
        jtxAge.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jtxAge.setForeground(SystemColor.activeCaption);
        jtxAge.setBounds(new Rectangle(84, 82, 222, 27));
        jtxType.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jtxType.setForeground(SystemColor.activeCaption);
        jtxType.setText("");
        jtxType.setBounds(new Rectangle(84, 44, 222, 27));
       jLabel26.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
       jLabel26.setForeground(Color.blue);
       jLabel26.setText("读者性别");
       jLabel26.setBounds(new Rectangle(7, 79, 62, 30));
        jtxBanzhengTime.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jtxBanzhengTime.setForeground(SystemColor.activeCaption);
        jtxBanzhengTime.setBounds(new Rectangle(82, 117, 222, 27));
       jTpRightBottomjPanel3.setBounds(new Rectangle());
       jTpRightBottomjPanel3.addComponentListener(new
                                                  ReaderSystemChaXunPanel_jTpRightBottomjPanel3_componentAdapter(this));
        jTpRightBottomjPanel3.setBorder(null);
        jTpRightBottomjPanel3.setBounds(new Rectangle(2, 25, 981, 246));
        topjLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        topjLabel1.setForeground(Color.blue);
        topjLabel1.setHorizontalAlignment(SwingConstants.CENTER);
        topjLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
        topjLabel1.setText("当前读者的信息");
        topjLabel1.setBounds(new Rectangle(68, 2, 200, 24));
        jScrollPane2.setBorder(BorderFactory.createEtchedBorder());
        jScrollPane2.setBounds(new Rectangle(320, 11, 210, 194));
        //jTpRightBottomjPanel3.setBounds(jTpRightM.getBounds());

        this.add(jPanelSystemTop);
        jPanelSystemTop.add(jBtqkjy);
       this.add(jTpRightM);
        jTpRightM.add(jTpRightBottomjPanel3);
        jTpRightM.add(topjLabel1);
        this.add(jPanelBottom);
        jPanelRigth1.add(jLabel52);
       jPanelRigth1.add(jLabel53);
       jPanelRigth1.add(jLabel51);
        jPanelRigth1.add(jtxZhengjianNum);
       jPanelRigth1.add(jtxIsJieshu);
       jPanelRigth1.add(jtxName);
        jPanelRigth1.add(jtxIsboorwre);
        jPanelRigth1.add(jLabel54);
        jPanelRigth1.add(jtxTelphone);
        jPanelRigth1.add(jLabel55);
        jPanelRigth1.add(jScrollPane2);
        jScrollPane2.getViewport().add(jlbMassage);
        jPanelBottom.add(jScrollPane1);
        jPanelBottom.add(jPanel1btmm);
        jScrollPane1.getViewport().add(radearjTable);
        jPanel1btmm.add(btnW);
       jPanel1btmm.add(btnY);
       jPanel1btmm.add(btnQ);
        jPanelLeft1.add(jLabel3);
       jPanelLeft1.add(jtxReaderNumZ);
       jPanelLeft1.add(jLabel25);
       jPanelLeft1.add(jtxType);
       jPanelLeft1.add(jtxAge);
       jPanelLeft1.add(jLabel26);
        jPanelLeft1.add(jtxBanzhengTime);
        jPanelLeft1.add(jLabel24);
        jPanelLeft1.add(jtxAddress);
        jPanelLeft1.add(jLabel23);
        jTpRightBottomjPanel3.add(jPanelRigth1);
        jTpRightBottomjPanel3.add(jPanelLeft1);
    }



   public void typeshow()
  {
      String sql = "select typeName,foregift,booksQuantity from readerType";
      int size = 0;
      ResultSet re=null;
      re = dh.search(sql);
      try {
          while(re.next())
             size++;
         ztype=new String[size];
         yajinArry= new float[size];
         borrorbook = new int[size];
          boolean temp =re.first();
          for(int i=0;temp;i++)
          {

              ztype[i]=re.getString(1).trim();
           //   jtxType1.addItem(ztype[i]);
              yajinArry[i]=re.getFloat(2);
               borrorbook[i] = re.getInt(3);
              temp =re.next();
          }
         // jtxType1 = new JComboBox(ztype);
        //  jtxType1.updateUI();

      } catch (SQLException ex) {
          System.out.println(ex.toString());

      }
      dh.myClose(1);
  }


   public void this_ancestorResized(HierarchyEvent e) {
       jTpRightM.setSize((this.getWidth()) - 5,
                         (this.getHeight() - 30) * 5/ 9);
       jPanelBottom.setBounds(1, jTpRightM.getHeight() + jTpRightM.getY(),
                              (this.getWidth()) - 5,
                              (this.getHeight() - 30) * 4 / 9);
       jPanelSystemTop.setSize((this.getWidth()) - 5, 30);
   }

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

   public void jSpSystemPanel_componentResized(ComponentEvent e) {

   }

   public void jPanelBottom_componentResized(ComponentEvent e) {
       jScrollPane1.setBounds(1, 2, jPanelBottom.getWidth() - 5,
                              jPanelBottom.getHeight() - 33);
       jPanel1btmm.setBounds(1, jPanelBottom.getHeight() - 31,
                             jPanelBottom.getWidth() - 5, 28);
   }

   public void jPanel1btmm_componentResized(ComponentEvent e) {
       btnQ.setBounds((jPanel1btmm.getWidth() / 3 - 100) / 2, 4, 110, 23);
       btnW.setBounds((jPanel1btmm.getWidth() / 3 - 100) / 2 +
                      jPanel1btmm.getWidth() / 3, 4, 110, 23);
       btnY.setBounds((jPanel1btmm.getWidth() / 3 - 100) / 2 +
                      jPanel1btmm.getWidth() * 2 / 3, 4, 110, 23);
   }

   public void jtxBanzhengshijian_actionPerformed(ActionEvent e) {
    }
   public void qingkong()
   {
    }
   public void jButton8_actionPerformed(ActionEvent e) {
       qingkong();
   }


   public void jtxBanzhengshijian_mouseClicked(MouseEvent e) {

    }

   //设置显示的押金
  /*
   private void yajingShow()
   {
       int size= ;
       int i=0;
       while(i < size){
           if ( == i){
               jtxYajin1.setText("押金是 " + yajinArry[i] + " 元");
               yj=yajinArry[i];
               break;
           }
           i++;
       }
   }
  */


   public void btnQ_actionPerformed(ActionEvent e) {
       shuaxin(radearjTable, -1);
   }

   public void shuaxin(JTable jta, int x) {
       String sql = "";
       if (x == 0)
           sql = "select readerID,readerName,readerSex,readerAddress,readerTelephone,readerTypeName,state,可借书数量=(booksQuantity-borrowBooksNum),beginTime,certificateNum  from reader  where state=0";
       else if (x == 1)
           sql = "select readerID,readerName,readerSex,readerAddress,readerTelephone,readerTypeName,state ,可借书数量=(booksQuantity-borrowBooksNum),beginTime,certificateNum from reader where state=1";
       else
           sql = "select readerID,readerName,readerSex,readerAddress,readerTelephone,readerTypeName,state,可借书数量=(booksQuantity-borrowBooksNum),beginTime,certificateNum from reader";

       dh.search(sql);
       int size = 0;
       try {
           while (dh.rs.next())
               size++;
           date = new Object[size][title.length];
           boolean a = dh.rs.first();
           for (int i = 0; a; i++) {

               date[i][0] = dh.rs.getString(1).trim();
               date[i][1] = dh.rs.getString(2).trim();
               date[i][2] = dh.rs.getString(3).trim();
               date[i][3] = dh.rs.getString(4).trim();
               date[i][4] = dh.rs.getString(5).trim();
               date[i][5] = dh.rs.getString(6).trim();
               date[i][6] = "" + dh.rs.getBoolean(7);
               date[i][7] = "" + dh.rs.getInt(8);
               date[i][8] = dh.rs.getString(9).trim();
               date[i][9] = dh.rs.getString(10).trim();
               a = dh.rs.next();
           }
           DefaultTableModel model = new DefaultTableModel(date, title);
           jta.setModel(model);
           jta.updateUI();

       } catch (SQLException ex) {
           System.out.println(ex.toString());
       }
       dh.myClose(1);

   }

   public void btnW_actionPerformed(ActionEvent e) {
       shuaxin(radearjTable, 0);
   }

   public void btnY_actionPerformed(ActionEvent e) {
       shuaxin(radearjTable, 1);
   }

   public void jScrollPane1_componentResized(ComponentEvent e) {
       radearjTable.setSize(jScrollPane1.getWidth(),jScrollPane1.getHeight());
   }


   public void inputReaderNum(JTextField a,JTextArea b)
  {
      String bianhao="";
      try {
            bianhao= JOptionPane.showInputDialog(null,"请输入读者编号    例如 ","A0000001").trim();
      } catch (Exception ex) {
         // JOptionPane.showMessageDialog(null, "你没有输入读者信息");
      }

     if(!bianhao.equals("")){
         if ((int)bianhao.charAt(0)>='A' && (int)bianhao.charAt(0) <= 'Z' )
             {
             a.setText(""+bianhao);
             borrowBooksNum(a, b);
         }
     }
  }

  //点击查询读者的借书数量
 public void borrowBooksNum(JTextField a,JTextArea b)
 {

     String bianhao = "";
    if (!a.getText().trim().equals(""))
         bianhao = a.getText().trim();
     String snum = "";
     int num=0;
     String readerTypeNameTemp = "";

     if ((int)bianhao.charAt(0)>='A' && (int)bianhao.charAt(0) <= 'Z' ) {
       //  Dbcom readerDB = new Dbcom();
         ResultSet rs = null;
         //查询读者的借书数量
         String sql =
                 "select borrowBooksNum,readerTypeName from readerInfo where readerID='" +
                 bianhao + "'";
         //rs = readerDB.search(sql);
         rs = dh.search(sql);
         try {
             if (rs.next()) {
                 snum = rs.getString(1);
                 if (snum == null)
                     snum="0";

⌨️ 快捷键说明

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