title: invoke an integer and double in JFrame.JTextField().setText();
body: <p>I just learn a ORM with MVC. I make a class.</p>
  
  <pre><code>public bookController {
  
  private static final Connection Connection = null;
      JFramebookstore frameBookstore;
      Bookimpl bookimpl;
      List&lt;book&gt; listbook;
  
  // and i just add a function to show a books that choose from JTableBooks
  
  public void showfield(int row) {
     frameBookstore.JtextBookid().setText(listbook().get(row).getBookId().toString());
  frameBookstore.JtextSellingprice().setText(listbook().get(row).getsellprice().toString());
    }
  }
  </code></pre>
  
  <p>I have an error to invoke getBookid()and getbooksellprice()</p>
  
  <p>This is my Constructor class</p>
  
  <pre><code>public class book {
  
  private int bookid;
  private double booksellprice;
  
  public final int getBookid() {
          return bookid;
      }
      public final void setBookid(int bookid) {
          this.bookid = bookid;
      }
  
  public final double getBooksellprice() {
          return booksellprice;
      }
      public final void setBooksellprice(int booksellprice) {
          this.booksellprice= bookselprice;
      }
  
  public book(int bookid, double booksellprice){
  
     super();
     this.bookid = bookid;
     this.booksellprice = booksellprice;
    }
  
      @Override
      public String toString() {
          return "book [bookid=" + bookid + ", booksellprice=" +booksellprice+"]
   }
  }
  </code></pre>
  
  <p>I have read the <a href="https://docs.oracle.com/javase/tutorial/java/data/strings.html" rel="nofollow">tutorial String</a> but still I cannot solve my own self.</p>
  
  <p>this is my bookTable model extends AbstractTableModel </p>
  
  <pre><code> public class bookTableModel extends AbstractTableModel {
  
   list&lt;book&gt; books;
  
  public bookTableModel(List&lt;book&gt; books) {
      this.books = books;
  
  
  @Override
  public int getRowCount() {
      // TODO Auto-generated method stub
      return books.size();
  }
  
  @Override
  public int getColumnCount() {
      // TODO Auto-generated method stub
      return 2;
  }
  
  public String getColumnName(int column) {
      switch (column) {
      case 0:
          return "bookid";
      case 1:
          return "booksellprice";
      default :
          return null;
  
      }
  
  }
  
  @Override
  public Object getValueAt(int row, int column) {
      switch (column) {
      case 0:
          return books.get(row).getbookid();
      case 1:
          return books.get(row).getbooksellprice();
      default:
          return null;
      }
  }
   }
  }
  </code></pre>
  
  <p>this is my bookDAO class implement bookimpl</p>
  
  <pre><code>'@Override
  public class BookDAO implements bookimpl {
  private final String select = "SELECT * FROM DSCM.BookData ";
  
  public List&lt;book&gt; getByAll() t{
      List&lt;book&gt; books = null;
  
  
      try {
          books = new ArrayList&lt;book&gt;();
          Statement statement =  connection.createStatement();
          ResultSet result = statement.executeQuery(select);
  
  
          while (result.next()) {
              book b = new book();
  
              b.setbookid(result.getInt("bookid"));
              b.setbookid(result.getDouble("booksellprice"));
  
  
              books.add(book);
          }
  
  
      } catch (SQLException ex) {
          ex.printStackTrace();
      }
      return books;  
  
   }
  }'
  </code></pre>
  
  <p>and this is my bookimpl class </p>
  
  <pre><code>public interface bookimpl {
  
  public void insertbook(Book b) throws Dascomerror;
  
  public void updatebook(book b) throws Dascomerror;
  
  public void deletebook(int bookid) throws Dascomerror;
  
  public List&lt;book&gt; getByAll() throws Dascomerror;
  
  '
  </code></pre>
  
  <p>the error its says </p>
  
  <pre><code>java.lang.NullPointerException
  at com.dascom.dao.bookDAO.getByAll(bookDAO.java:138)
  at com.dascom.controller.bookController.&lt;init&gt;(bookController.java:38)
  at com.dascom.view.JFramebook.&lt;init&gt;(JFramebook.java:136)
  </code></pre>