亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? borrowbooks.java

?? java編寫的圖書管理系統
?? JAVA
字號:
//import the packages for using the classes in them into the program
   import java.awt.*;
   import java.util.*;
   import java.text.*;
   import javax.swing.*;
   import java.awt.event.*;

/**
 *A public class
 */
   public class borrowBooks extends JInternalFrame {
   /***************************************************************************
    ***      declaration of the private variables used in the program       ***
    ***************************************************************************/
   
   //for creating the North Panel
      private JPanel northPanel = new JPanel();
   //for creating the label
      private JLabel title = new JLabel("BOOK INFORMATION");
   
   //for creating the Center Panel
      private JPanel centerPanel = new JPanel();
   //for creating an Internal Panel in the center panel
      private JPanel informationPanel = new JPanel();
   //for creating an array of JLabel
      private JLabel[] informationLabel = new JLabel[4];
   //for creating an array of String
      private String[] informationString = {" Write the Book ID:", " Write the Member ID:",
         " The Current Data:" , " The Return Date:"};
   //for creating an array of JTextField
      private JTextField[] informationTextField = new JTextField[4];
   //for creating the date in the String
      private String date = new SimpleDateFormat("dd-MMM-yy",Locale.US).format(new java.util.Date());
    // for internationalization purpose can use second option  
    //private String date = new SimpleDateFormat("dd-MMM-yy",Locale.getDefault()).format(new java.util.Date());
   
   //for creating an array of string to store the data
      private String[] data;
   
   //for creating an Internal Panel in the center panel
      private JPanel borrowButtonPanel = new JPanel();
   //for creating the button
      private JButton borrowButton = new JButton("Borrow");
   
   //for creating South Panel
      private JPanel southPanel = new JPanel();
   //for creating the button
      private JButton cancelButton = new JButton("Cancel");
   
   //for creating an object from toDatabase() class
      private toDatabase dataToDatabase;
   //for checking the information from the text field
      public boolean isCorrect() {
         data = new String[4];
         for(int i = 0; i < informationLabel.length; i++) {
            if(!informationTextField[i].getText().equals(""))
               data[i] = informationTextField[i].getText();
            else 
               return false;
         }
         return true;
      }
   //constructor of borrowBooks
      public borrowBooks() {
      //for setting the title for the internal frame
         super("Borrow Books", false, true, false, true);
      //for setting the icon
         setFrameIcon(new ImageIcon(ClassLoader.getSystemResource("images/Export16.gif")));
      //for getting the graphical user interface components display area
         Container cp = getContentPane();
      
      //for setting the layout
         northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
      //for setting the font
         title.setFont(new Font("Tahoma", Font.BOLD, 14));
      //for adding the label to the panel
         northPanel.add(title);
      //for adding the panel to the container
         cp.add("North", northPanel);
      
      //for setting the layout
         centerPanel.setLayout(new BorderLayout());
      //for setting the layout for the internal panel
         informationPanel.setLayout(new GridLayout(4,2,1,1));
      
      /***********************************************************************
       * for adding the strings to the labels, for setting the font 		   *
       * and adding these labels to the panel.							   *
       * finally adding the panel to the container						   *
       ***********************************************************************/
         for(int i = 0; i < informationLabel.length; i++) {
            informationPanel.add(informationLabel[i] = new JLabel(informationString[i]));
            informationLabel[i].setFont(new Font("Tahoma", Font.BOLD, 11));
            if(i == 2) {
               informationPanel.add(informationTextField[i] = new JTextField(date));
               informationTextField[i].setFont(new Font("Tahoma", Font.PLAIN, 11));
               informationTextField[i].setEnabled(false);
            }
            else {
               informationPanel.add(informationTextField[i] = new JTextField());
               informationTextField[i].setFont(new Font("Tahoma", Font.PLAIN, 11));
            }
         }	
         centerPanel.add("Center", informationPanel);
      
      //for setting the layout
         borrowButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
      //for setting the font to the button
         borrowButton.setFont(new Font("Tahoma", Font.BOLD, 11));
      //for adding the button to the panel
         borrowButtonPanel.add(borrowButton);
      //for adding the panel to the center panel
         centerPanel.add("South", borrowButtonPanel);
      //for setting the border to the panel
         centerPanel.setBorder(BorderFactory.createTitledBorder("Borrow a book:"));
      //for adding the panel to the container
         cp.add("Center", centerPanel);
      
      //for adding the layout
         southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
      //for setting the font to the button
         cancelButton.setFont(new Font("Tahoma", Font.BOLD, 11));
      //for adding the button to the panel
         southPanel.add(cancelButton);
      //for setting the border to the panel
         southPanel.setBorder(BorderFactory.createEtchedBorder());
      //for adding the panel to the container
         cp.add("South", southPanel);
      
      /***********************************************************************
       * for adding the action listener to the button,first the text will be *
       * taken from the JTextField[] and make the connection for database,   *
       * after that update the table in the database with the new value      *
       ***********************************************************************/
         borrowButton.addActionListener(
                                 new ActionListener() {
                                    public void actionPerformed(ActionEvent ae) {
                                    //for checking if there is a missing information
                                       if(isCorrect()) {
                                          Thread runner = 
                                             new Thread() {
                                                public void run() {
                                                   dataToDatabase = new toDatabase();
                                                //for checking if there is no same information in the database
                                                   if((dataToDatabase.memberID("SELECT MemberID FROM Books WHERE BookID = " + data[0])) == 0) {
                                                      dataToDatabase.update("UPDATE Books SET Availble = false, " +
                                                                           "DateOfBorrowed = '" + data[2] + "', " +
                                                                           "DateOfReturn   = '" + data[3] + "', " +
                                                                           "MemberID       =  " + data[1] +
                                                                           " WHERE BookID  =  " + data[0]);
                                                      int numberOfBooks = 1 + dataToDatabase.numberOfBooks("SELECT numberOfBooks FROM " +
                                                                        "Members WHERE MemberID = " + data[1]);
                                                      dataToDatabase.update("UPDATE Members SET numberOfBooks = " +
                                                                           numberOfBooks + " WHERE MemberID = " + data[1]);
                                                   //for setting the array of JTextField to null
                                                      for(int i = 0; i < informationTextField.length; i++)
                                                         if(i != 2)
                                                            informationTextField[i].setText(null);
                                                   }
                                                   else
                                                      JOptionPane.showMessageDialog(null,"The book is borrowed","Warning",JOptionPane.WARNING_MESSAGE);
                                                }
                                             };
                                          runner.start();
                                       }
                                       //if there is a missing data, then display Message Dialog
                                       else
                                          JOptionPane.showMessageDialog(null,"Please, complete the information","Warning",JOptionPane.WARNING_MESSAGE);
                                    }
                                 });
      //for adding the action listener for the button to dispose the frame
         cancelButton.addActionListener(
                                 new ActionListener() {
                                    public void actionPerformed(ActionEvent ae) {
                                       dispose();
                                    }
                                 });
      //for setting the visible to true
         setVisible(true);
      //show the internal frame
         pack();
      }
   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频一区二区三区免费| 欧美日韩美少妇| 免费成人在线视频观看| 一区二区三区四区高清精品免费观看 | 亚洲成av人片一区二区三区 | av动漫一区二区| 国产剧情一区在线| 久久se精品一区二区| 美女脱光内衣内裤视频久久网站 | 麻豆中文一区二区| 日本不卡的三区四区五区| 亚洲1区2区3区视频| 午夜精品福利一区二区三区蜜桃| 亚洲午夜羞羞片| 秋霞电影网一区二区| 久草中文综合在线| 国产精品 欧美精品| av亚洲精华国产精华精华| 91麻豆成人久久精品二区三区| 日本韩国一区二区三区| 欧美日韩五月天| 精品久久人人做人人爰| 国产精品久久毛片| 亚洲国产日产av| 久久精品国产亚洲高清剧情介绍 | 91国模大尺度私拍在线视频| 欧美午夜片在线观看| 日韩午夜电影在线观看| 国产日韩高清在线| 亚洲与欧洲av电影| 老司机精品视频导航| 99免费精品视频| 欧美一区二区二区| 国产精品久久久久久久久图文区| 亚洲国产乱码最新视频| 精品一区二区三区不卡| 色综合久久综合网欧美综合网| 91精品在线观看入口| 亚洲国产激情av| 天天综合天天综合色| 国产乱码精品一区二区三| 91福利精品第一导航| 精品奇米国产一区二区三区| 亚洲欧美日韩精品久久久久| 麻豆中文一区二区| 欧美色图激情小说| 国产午夜精品一区二区三区四区| 五月婷婷色综合| 成人av在线观| 精品久久久久久久人人人人传媒| 亚洲黄色免费电影| 国产成人精品一区二区三区四区| 欧美丝袜丝nylons| 成人欧美一区二区三区在线播放| 免费高清在线一区| 欧美精品日韩一区| 亚洲精品乱码久久久久| 国产成人精品免费一区二区| 日韩丝袜情趣美女图片| 午夜精品久久久久久久久久| 91香蕉视频黄| 国产精品乱码久久久久久| 韩国成人在线视频| 日韩网站在线看片你懂的| 污片在线观看一区二区| 欧美在线观看一区二区| 亚洲女人****多毛耸耸8| 国产馆精品极品| 欧美精品一区二区精品网| 麻豆精品一区二区三区| 7777精品伊人久久久大香线蕉超级流畅 | av网站一区二区三区| 久久久久97国产精华液好用吗 | 国产人伦精品一区二区| 国内精品国产成人国产三级粉色| 91精品在线一区二区| 一区二区三区精品在线| 在线精品观看国产| 一个色综合av| 欧美精品在线一区二区| 午夜精品一区二区三区免费视频 | 中文字幕一区二区日韩精品绯色| 国产精品资源在线观看| 久久久91精品国产一区二区精品| 狠狠色丁香久久婷婷综合_中| 欧美va日韩va| 国产精品一卡二| 国产精品情趣视频| 91蝌蚪porny| 午夜精品福利在线| 日韩欧美第一区| 国产大陆精品国产| 亚洲欧美偷拍另类a∨色屁股| 在线观看91精品国产入口| 午夜免费欧美电影| 欧美成人欧美edvon| 国产成人小视频| 亚洲伦理在线免费看| 欧美男男青年gay1069videost| 蜜臀a∨国产成人精品| 国产性色一区二区| 在线国产亚洲欧美| 久久国产日韩欧美精品| 亚洲国产成人私人影院tom| 色综合久久99| 美国三级日本三级久久99| 国产清纯美女被跳蛋高潮一区二区久久w | 天天亚洲美女在线视频| 精品成人免费观看| 色综合久久中文字幕| 青青草国产精品亚洲专区无| 中文字幕不卡三区| 欧美乱妇一区二区三区不卡视频| 精品一区二区在线视频| 亚洲欧美另类图片小说| 精品国产一区二区三区久久久蜜月| 成人免费观看av| 日韩成人av影视| 国产精品少妇自拍| 日韩一区二区三区在线观看| 成人精品鲁一区一区二区| 日本系列欧美系列| 一区二区三区四区蜜桃| 国产日韩欧美不卡在线| 欧美喷水一区二区| 色噜噜狠狠一区二区三区果冻| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲乱码中文字幕| 欧美激情一区在线| 精品理论电影在线观看 | 日韩av一级电影| 亚洲欧美偷拍三级| 国产精品你懂的| 精品久久人人做人人爱| 91精品国产91热久久久做人人 | 麻豆91在线观看| 亚洲高清不卡在线| 亚洲色欲色欲www| 国产欧美一区二区三区网站| 日韩精品综合一本久道在线视频| 欧美视频你懂的| 在线亚洲精品福利网址导航| 国产69精品久久久久777| 激情欧美一区二区三区在线观看| 午夜免费久久看| 午夜精品一区二区三区电影天堂 | 精品一区二区三区在线观看| 肉丝袜脚交视频一区二区| 一区二区三区国产精华| 亚洲欧美日韩综合aⅴ视频| 中文字幕不卡在线| 亚洲欧洲三级电影| 国产精品久久久一区麻豆最新章节| 精品国产99国产精品| 精品国产精品网麻豆系列| 日韩欧美中文一区| 欧美本精品男人aⅴ天堂| 欧美一区二区三区不卡| 91精品在线麻豆| 日韩一区和二区| 精品日韩99亚洲| 精品99久久久久久| 国产欧美一区在线| 国产精品高潮久久久久无| 亚洲人一二三区| 亚洲永久精品国产| 日本欧美一区二区三区| 麻豆精品久久精品色综合| 免费观看一级特黄欧美大片| 国产专区欧美精品| 国产.精品.日韩.另类.中文.在线.播放| 国产成人啪免费观看软件| av中文字幕亚洲| 欧美色欧美亚洲另类二区| 69堂成人精品免费视频| 久久亚洲精华国产精华液| 欧美激情在线免费观看| 亚洲已满18点击进入久久| 午夜不卡av在线| 国产乱理伦片在线观看夜一区| 暴力调教一区二区三区| 欧美亚洲尤物久久| 欧美电影免费观看高清完整版在| 国产亚洲精品福利| 亚洲一区二区三区视频在线播放 | 中文字幕一区二区三区不卡在线| 亚洲一级在线观看| 国产精品一区二区免费不卡| 91丨porny丨在线| 日韩一区二区三区在线| ...av二区三区久久精品| 三级影片在线观看欧美日韩一区二区| 韩国理伦片一区二区三区在线播放| 99久久99久久免费精品蜜臀| 欧美日韩国产系列| 中文字幕av资源一区| 美腿丝袜亚洲一区| 色综合激情久久| 欧美国产日本韩| 久久99精品一区二区三区三区|