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

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

?? addbooks.java

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

/**
 *A public class
 */
   public class addBooks extends JInternalFrame {
   /***************************************************************************
    ***      declaration of the private variables used in the program       ***
    ***************************************************************************/
   
   //for creating the North Panel
      private JPanel northPanel = new JPanel();
   //for creaing the North Label
      private JLabel northLabel = 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 informationLabelPanel = new JPanel();
   
   //for creating an array of JLabel
      private JLabel[] informationLabel = new JLabel[8];
   //for creating an array of String
      private String[] informationString = {
         "Book's Subject: ","Book's Title: ",
         "Author(s)'s Name: ","Publisher's Name: ",
         "Book's Copyright: ","Edition number: ",
         "Number of Pages: ","Book's ISBN"
      };
   //for creating an Internal Panel in the center panel
      private JPanel informationTextFieldPanel = new JPanel();
   //for creating an array of JTextField
      private JTextField[] informationTextField = new JTextField[8];
   
   //for creating an Internal Panel in the center panel
      private JPanel insertInformationButtonPanel = new JPanel();
   //for creating a button
      private JButton insertInformationButton = new JButton("Insert the Information");
   
   //for creating South Panel
      private JPanel southPanel = new JPanel();
   //for creating a button
      private JButton OKButton = new JButton("Exit");
   
   //create objects from another classes for using them in the ActionListener
      private toDatabase dataToDatabase;
   //for creating an array of string to store the data
      private String[] data;
   //for setting availble option to true
      private boolean availble = true;
   
   //for checking the information from the text field
      public boolean isCorrect() {
         data = new String[8];
         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 addBooks
      public addBooks() {
      //for setting the title for the internal frame
         super("Add New Books",false, true, false, true);
      //for setting the icon
         setFrameIcon(new ImageIcon(ClassLoader.getSystemResource("images/Add16.gif")));
      //for getting the graphical user interface components display area
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout(5,5));
      //for setting the layout
         northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
      //for setting the font for the North Panel
         northLabel.setFont(new Font("Tahoma", Font.BOLD, 14));
      //for adding the label in the North Panel
         northPanel.add(northLabel);
      //for adding the north panel to the container
         cp.add(northPanel,BorderLayout.NORTH);
      
      //for setting the layout
         centerPanel.setLayout(new BorderLayout());
      //for setting the border to the panel
         centerPanel.setBorder(BorderFactory.createTitledBorder("Add a new book:"));
      //for setting the layout
         informationLabelPanel.setLayout(new GridLayout(8,1,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++) {
            informationLabelPanel.add(informationLabel[i] = new JLabel(informationString[i]));
            informationLabel[i].setFont(new Font("Tahoma", Font.BOLD, 11));
         }	
         centerPanel.add(informationLabelPanel,BorderLayout.WEST);
      
      //for setting the layout
         informationTextFieldPanel.setLayout(new GridLayout(8,1,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 < informationTextField.length; i++) {
            informationTextFieldPanel.add(informationTextField[i] = new JTextField(25));
            informationTextField[i].setFont(new Font("Tahoma", Font.PLAIN, 11));
         }	
         centerPanel.add(informationTextFieldPanel,BorderLayout.EAST);
      
      /***********************************************************************
       * for setting the layout for the panel,setting the font for the button*
       * and adding the button to the panel.								   *
       * finally adding the panel to the container						   *
       ***********************************************************************/
         insertInformationButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
         insertInformationButton.setFont(new Font("Tahoma", Font.BOLD, 11));
         insertInformationButtonPanel.add(insertInformationButton);
         centerPanel.add( insertInformationButtonPanel,BorderLayout.SOUTH);
         cp.add(centerPanel,BorderLayout.CENTER);
      
      /***********************************************************************
       * for setting the layout for the panel,setting the font for the button*
       * adding the button to the panel & setting the border.				   *
       * finally adding the panel to the container						   *
       ***********************************************************************/
         southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
         OKButton.setFont(new Font("Tahoma", Font.BOLD, 11));
         southPanel.add(OKButton);
         southPanel.setBorder(BorderFactory.createEtchedBorder());
         cp.add(southPanel,BorderLayout.SOUTH);
      
      /***********************************************************************
       * 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      *
       ***********************************************************************/
         insertInformationButton.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.isDouble("SELECT BookID FROM Books WHERE ISBN = '" + data[7] + "'")) {
                                                      dataToDatabase.update("INSERT INTO Books (Subject,Title,Author,"+
                                                                           "Publisher,Copyright,Edition,Pages,ISBN,Availble) VALUES ('"+
                                                                           data[0] + "','" + data[1] + "','" + data[2] + "','"+ 
                                                                           data[3] + "', " + data[4] + ", "  + data[5] + ", " +
                                                                           data[6] + ", '" + data[7] + "', " + availble+ ")");
                                                   //for setting the array of JTextField to empty
                                                      for(int i = 0; i < informationTextField.length; i++)
                                                         informationTextField[i].setText(null);
                                                   }
                                                   else
                                                      JOptionPane.showMessageDialog(null,"The book is in the library","Error",JOptionPane.ERROR_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
         OKButton.addActionListener(
                                 new ActionListener() {
                                    public void actionPerformed(ActionEvent ae) {
                                       dispose();
                                    }
                                 });
         setSize(450,330);
         setVisible(true);
      }
   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www亚洲一区| 日韩成人午夜精品| 国产精品456露脸| 亚洲激情中文1区| 91精品国产综合久久久蜜臀粉嫩| 蜜乳av一区二区| 亚洲欧美另类在线| 这里是久久伊人| 欧美日韩视频一区二区| 高清国产午夜精品久久久久久| 亚洲精品视频免费观看| 亚洲一区在线免费观看| 国产亚洲成aⅴ人片在线观看| 91久久免费观看| 成人中文字幕在线| 国内精品伊人久久久久av一坑| 一区二区日韩电影| 国产精品剧情在线亚洲| 2017欧美狠狠色| 国产精品美女视频| 国产日韩欧美麻豆| 欧美一级片在线| 欧洲色大大久久| 91美女片黄在线观看91美女| 国产伦精品一区二区三区免费迷 | 欧美一区二区视频在线观看2022| 欧美羞羞免费网站| 色综合久久久久久久久久久| 国产91精品在线观看| 色综合一个色综合亚洲| 丰满白嫩尤物一区二区| 欧洲精品中文字幕| 日韩欧美电影在线| 欧美一级片在线看| 18成人在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲h在线观看| 视频在线观看国产精品| 日韩高清电影一区| 成人网页在线观看| 日韩视频一区二区三区在线播放| 欧美美女黄视频| 91精品国产手机| 亚洲欧洲日韩女同| 国产综合久久久久久久久久久久| 91免费精品国自产拍在线不卡| 制服丝袜国产精品| 亚洲免费观看高清在线观看| 精品一区二区三区蜜桃| 国产福利精品一区| 日本韩国精品一区二区在线观看| 精品久久人人做人人爽| 国产人成亚洲第一网站在线播放| 亚洲不卡av一区二区三区| 成人毛片在线观看| 久久久久久久久久久久电影| 国产精品进线69影院| 国产一级精品在线| 日韩精品最新网址| 午夜精彩视频在线观看不卡| 青青草视频一区| 国产99精品国产| 精品久久久久久亚洲综合网| 午夜精品免费在线| 欧美少妇xxx| 亚洲综合av网| 欧美在线一区二区三区| 亚洲三级在线免费观看| 天天综合色天天| 欧美日韩在线免费视频| 亚洲人成精品久久久久久| 成人av影视在线观看| 欧美日韩aaaaaa| 国产精品国产三级国产普通话蜜臀 | 日韩欧美在线网站| 日韩中文字幕麻豆| 日韩三级在线免费观看| 天天影视网天天综合色在线播放| 欧美精品视频www在线观看| 亚洲午夜免费电影| 丰满少妇在线播放bd日韩电影| 国产欧美日韩精品a在线观看| 国产永久精品大片wwwapp| 亚洲精品一区二区三区影院 | 亚洲欧美aⅴ...| 91免费观看国产| 亚洲午夜久久久久久久久久久 | 色噜噜狠狠成人中文综合| 亚洲伦在线观看| 欧美日韩激情一区| 美女网站色91| 国产欧美日韩精品a在线观看| 成人午夜视频免费看| 综合av第一页| 欧美一级精品大片| 成人小视频在线观看| 亚洲欧美日韩人成在线播放| 欧美日韩一区不卡| 紧缚捆绑精品一区二区| 国产精品女主播av| 欧美日本视频在线| 国产精品 日产精品 欧美精品| 自拍偷拍欧美激情| 欧美一区二区在线看| 粉嫩久久99精品久久久久久夜| 亚洲精品自拍动漫在线| 日韩一级大片在线观看| 国产高清成人在线| 五月天亚洲婷婷| 国产免费久久精品| 欧美日韩黄色影视| www.亚洲国产| 国产日韩v精品一区二区| 91视频在线看| 精品在线亚洲视频| 亚洲精品网站在线观看| 精品国产乱码久久久久久老虎 | 国产aⅴ综合色| 日韩高清不卡一区二区三区| 国产精品乱人伦中文| 日韩视频在线你懂得| 91官网在线免费观看| 国产精品资源在线观看| 日本成人在线网站| 亚洲女人****多毛耸耸8| 精品久久免费看| 这里只有精品免费| 欧美视频在线一区二区三区 | 亚洲男人天堂一区| 久久午夜老司机| 91精品国模一区二区三区| 91色视频在线| 大尺度一区二区| 国产一区二区三区精品视频| 亚洲一区二区在线免费看| 国产欧美精品区一区二区三区| 日韩一区二区三区在线| 在线观看国产一区二区| 成人sese在线| 成人亚洲精品久久久久软件| 国产自产2019最新不卡| 麻豆精品在线播放| 美女视频免费一区| 免费人成网站在线观看欧美高清| 亚洲午夜久久久久久久久电影院| 国产精品久久精品日日| 国产无一区二区| 日本一区二区不卡视频| 91麻豆swag| 色综合天天性综合| 91丨国产丨九色丨pron| 色噜噜狠狠色综合中国| 欧美在线观看视频在线| 色视频成人在线观看免| 欧美在线免费观看亚洲| 欧美日韩视频在线第一区 | 91精品国产综合久久国产大片| 在线观看日韩电影| 欧美狂野另类xxxxoooo| 6080日韩午夜伦伦午夜伦| 欧美精品日韩综合在线| 日韩一级大片在线观看| 久久综合色之久久综合| 国产亚洲视频系列| **欧美大码日韩| 亚洲成人午夜电影| 久久99精品久久久| 国产成人一区在线| 91在线观看成人| 欧美一区二区三区视频在线观看| 777a∨成人精品桃花网| 日韩一区二区三区电影在线观看 | 91一区二区在线观看| 欧洲国内综合视频| 69精品人人人人| 久久久亚洲精品石原莉奈| 国产精品天美传媒| 天天影视涩香欲综合网 | 亚洲国产成人va在线观看天堂| 麻豆精品视频在线| 成人高清在线视频| 7777精品久久久大香线蕉| 精品国产乱码91久久久久久网站| 国产精品三级av在线播放| 亚洲尤物在线视频观看| 久久精品国产99国产| 日韩综合在线视频| 大桥未久av一区二区三区中文| 欧美手机在线视频| 亚洲国产高清在线| 日韩国产一区二| 99视频精品在线| 日韩欧美高清dvd碟片| 亚洲日本成人在线观看| 久久99国内精品| 欧美在线免费观看亚洲| 中文乱码免费一区二区| 毛片基地黄久久久久久天堂| av一区二区三区黑人| 欧美成人伊人久久综合网|