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

📄 borrowhistorybystudentname.java~7~

📁 这是一个用JAVA编写的书籍借阅管理系统
💻 JAVA~7~
字号:
package bookmanager;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.*;import java.sql.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class borrowHistoryBystudentname extends JFrame {  ResultSet rs;    //resultset String sql; private DBManager db =new DBManager();  XYLayout xYLayout1 = new XYLayout();  JLabel jLabel4 = new JLabel();  JLabel jLabel1 = new JLabel();  JLabel jLabel3 = new JLabel();  JTextField jTextbdate = new JTextField();  JButton jButtonnext = new JButton();  JButton jButtonpre = new JButton();  JButton jButtonlast = new JButton();  JButton jButtonupdate = new JButton();  JLabel jLabel2 = new JLabel();  JTextField jTextbname = new JTextField();  JButton jButtonexit = new JButton();  JButton jButtondelete = new JButton();  JButton jButtonsearch = new JButton();  JButton jButtonfirst = new JButton();  JTextField jTextpname = new JTextField();  JTextField jTextrdate = new JTextField();  JTextField jTextcomment = new JTextField();  JLabel jLabel5 = new JLabel();  JPanel jPanel1 = new JPanel();  XYLayout xYLayout2 = new XYLayout();  public borrowHistoryBystudentname() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  public static void main(String[] args) {    borrowHistoryBystudentname borrowHistoryBystudentname = new borrowHistoryBystudentname();  }  private void jbInit() throws Exception {    jLabel5.setText("还阅日期");    jLabel5.setFont(new java.awt.Font("Dialog", 0, 16));    jTextcomment.setText("");    jTextcomment.setFont(new java.awt.Font("Dialog", 0, 16));    jTextrdate.setText("");    jTextrdate.setFont(new java.awt.Font("Dialog", 0, 16));    jTextpname.setText("");    jTextpname.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonfirst.setText("第一条");    jButtonfirst.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonsearch.setText("查询");    jButtonsearch.setFont(new java.awt.Font("Dialog", 0, 16));    jButtondelete.setFont(new java.awt.Font("Dialog", 0, 16));    jButtondelete.setText("删除");    jButtonexit.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonexit.setText("退出");    jTextbname.setText("");    jTextbname.setFont(new java.awt.Font("Dialog", 0, 16));    jLabel2.setText("书名");    jLabel2.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonupdate.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonupdate.setText("更新");    jButtonlast.setText("最后一条");    jButtonlast.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonpre.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonpre.setText("前一条");    jButtonnext.setFont(new java.awt.Font("Dialog", 0, 16));    jButtonnext.setText("后一条");    jTextbdate.setText("");    jTextbdate.setFont(new java.awt.Font("Dialog", 0, 16));    jLabel3.setText("借阅日起");    jLabel3.setFont(new java.awt.Font("Dialog", 0, 16));    jLabel1.setText("借阅者姓名");    jLabel1.setFont(new java.awt.Font("Dialog", 0, 16));    jLabel4.setText("备注");    jLabel4.setFont(new java.awt.Font("Dialog", 0, 16));    this.getContentPane().setLayout(xYLayout1);    xYLayout1.setWidth(656);    xYLayout1.setHeight(395);    jPanel1.setLayout(xYLayout2);    jPanel1.setBorder(BorderFactory.createLineBorder(Color.black));    this.addMouseListener(new borrowHistoryBystudentname_this_mouseAdapter(this));    this.getContentPane().add(jButtonsearch, new XYConstraints(441, 35, 104, 31));    this.getContentPane().add(jPanel1,   new XYConstraints(26, 88, 611, 229));    jPanel1.add(jTextbname, new XYConstraints(220, 29, 154, 23));    jPanel1.add(jTextrdate, new XYConstraints(221, 118, 137, -1));    jPanel1.add(jLabel4, new XYConstraints(65, 178, 66, 29));    jPanel1.add(jLabel3, new XYConstraints(67, 71, 87, 29));    jPanel1.add(jTextbdate, new XYConstraints(220, 72, 137, -1));    jPanel1.add(jLabel2, new XYConstraints(69, 14, 89, 35));    jPanel1.add(jTextcomment, new XYConstraints(219, 171, 324, -1));    jPanel1.add(jLabel5, new XYConstraints(64, 119, 87, 29));    this.getContentPane().add(jButtonnext, new XYConstraints(202, 346, 89, 26));    this.getContentPane().add(jButtonpre, new XYConstraints(119, 345, 82, 26));    this.getContentPane().add(jButtonlast, new XYConstraints(291, 346, 98, 27));    this.getContentPane().add(jButtonupdate, new XYConstraints(390, 347, 84, 27));    this.getContentPane().add(jButtonexit, new XYConstraints(559, 346, 70, 28));    this.getContentPane().add(jButtondelete, new XYConstraints(473, 347, 86, 28));    this.getContentPane().add(jButtonfirst, new XYConstraints(32, 344, 86, 26));    this.getContentPane().add(jTextpname, new XYConstraints(246, 42, 116, 26));    this.getContentPane().add(jLabel1, new XYConstraints(92, 39, 88, 33));  }  void showResult(){   try {       jTextpname.setText(rs.getString("studentname") );      jTextbname.setText(rs.getString("bookname") );      jTextbdate.setText(rs.getString("borrowdate") );      jTextrdate.setText(rs.getString("returndate") );      jTextcomment.setText(rs.getString("comment") );       }    catch (SQLException ex) {       } }  void this_mouseClicked(MouseEvent e) {    sql="select * from BookBorrow ";                // JOptionPane.showMessageDialog(null,jCombocolor.getSelectedItem().toString().trim() );                       if (jTextpname.getText().trim().length() ==0)                       {}                       else                       {                          sql=sql+"  where  studentname='"+jTextpname.getText().trim()+"'";                       }                        rs =db.getResult(sql);                       try {                         if(! rs.equals(null) )                         {  rs.next();                            showResult();                         }                       }                       catch (SQLException ex) {                          JOptionPane.showMessageDialog(null," search failed!");                       }  }}class borrowHistoryBystudentname_this_mouseAdapter extends java.awt.event.MouseAdapter {  borrowHistoryBystudentname adaptee;  borrowHistoryBystudentname_this_mouseAdapter(borrowHistoryBystudentname adaptee) {    this.adaptee = adaptee;  }  public void mouseClicked(MouseEvent e) {    adaptee.this_mouseClicked(e);  }}

⌨️ 快捷键说明

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