Examples of AuthorModel


Examples of Models.AuthorModel

        initComponents();
        fillTable();
    }
   
    private void fillTable(){
        AuthorModel authorModel = new AuthorModel();
      
        List<Author> authors = authorModel.all();
       
        AuthorTableModel authorTableModel = new AuthorTableModel(authors);
        jTable1.setModel(authorTableModel);
    }
View Full Code Here

Examples of Models.AuthorModel

        AuthorTableModel authorTableModel = new AuthorTableModel(authors);
        jTable1.setModel(authorTableModel);
    }
   
    private void fillTableSearch(String author_name){
        AuthorModel authorModel = new AuthorModel();
      
        List<Author> authors = authorModel.whereFullName(author_name);
       
        AuthorTableModel authorTableModel = new AuthorTableModel(authors);
        jTable1.setModel(authorTableModel);       
    }
View Full Code Here

Examples of Models.AuthorModel

        author.setAge(age);
      
        author.setLocation(txtAuthorLocation.getText());
        author.setDetails(txtAuthorDetails.getText());
       
        AuthorModel authorModel = new AuthorModel();
        int update_flag = authorModel.update(author);
        if(update_flag == 1){
            //tableModel.fireTableRowsUpdated(row-1, row+1);
            tableModel.fireTableDataChanged();
            jDialog1.dispose();
            JOptionPane.showMessageDialog(this, "Author "+author.getFull_name()+" updated!", "Success!", JOptionPane.INFORMATION_MESSAGE);
View Full Code Here

Examples of Models.AuthorModel

        fillComboBox();
    }
   
    private void fillComboBox(){
        ArrayList arrayList = new ArrayList();   // vector is Obsolete. Hence ArrayList
        AuthorModel authorModel = new AuthorModel();
      
        List<Author> authors = authorModel.all(); // This should be query based (Type text to fetch).
                                                  // Loading everything at once is just unnecessary.
        for (Author author : authors) {
           arrayList.add(author);
        }
        cmboxAuthor.setModel(new javax.swing.DefaultComboBoxModel(arrayList.toArray()));
View Full Code Here

Examples of Models.AuthorModel

        String location     = txtAuthorLocation.getText();
        int age             = Integer.parseInt(txtAuthorAge.getText());
        String details      = txtAuthorDetails.getText();

        Author author = new Author();
        AuthorModel authorModel = new AuthorModel();

        author.setFull_name(full_name);
        author.setLocation(location);
        author.setAge(age);
        author.setDetails(details);
       
        int flag = authorModel.save(author);
        if(flag == 1)
        {
            JOptionPane.showMessageDialog(null, "Author added !", "Message", JOptionPane.INFORMATION_MESSAGE);
            clearAllTextFields();
        }
View Full Code Here

Examples of com.tubeonfire.model.AuthorModel

      try {
        page = Integer.parseInt((String) req.getParameter("page"));
      } catch (Exception e) {
        page = 1;
      }
      AuthorModel model = new AuthorModel();
      model.setPage(page);
      model.prepareList();
      req.setAttribute("model", model);
      req.setAttribute("url", req.getRequestURL().toString());
      req.getRequestDispatcher("/list_author.jsp").forward(req, resp);
    } catch (Exception e) {
      log.warning(e.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.