title: JavaFX tableViews
body: <p>I have developed the table view in javaFX which retrieve data from database and display, but it only shows the double values which in price column, I have attach the code here.</p>
  
  <pre><code>public class stockViewController implements Initializable{
  
      @FXML
      private TextField search_txt;
  
      @FXML
      private TableView&lt;stock&gt; tableView;
  
      @FXML
      private TableColumn&lt;stock, String&gt; name12;
  
      @FXML
      private TableColumn&lt;stock, String&gt; categ12;
  
      @FXML
      private TableColumn&lt;stock, Double&gt; price12;
  
      @FXML
      private TableColumn&lt;stock, Integer&gt; qty12;
  
  
      @FXML
      private TableColumn&lt;stock, Integer&gt; bill12;
  
  
      @FXML
      private Button addNew;
  
      @FXML
      private Button additem;
  
  
  
  
      @FXML
      void additems(ActionEvent event) throws IOException{
          FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/view/stockMain.fxml"));
          Parent root1 = (Parent) fxmlLoader.load();
          Stage stage = new Stage();
          stage.setScene(new Scene(root1));  
          stage.show();
  
  
      }
  
      @FXML
      void viewCategory(ActionEvent event) throws IOException {
  
         FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/view/pieChart.fxml"));
          Parent root1 = (Parent) fxmlLoader.load();
          Stage stage = new Stage();
          stage.setScene(new Scene(root1));  
          stage.show();
  
  
      }
  
  
      @FXML
      void stockmain(ActionEvent event) throws IOException {
  
         FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/view/stockMain.fxml"));
          Parent root1 = (Parent) fxmlLoader.load();
          Stage stage = new Stage();
          stage.setScene(new Scene(root1));  
          stage.show();
  
      }
  
      //new one
      ObservableList&lt;stock&gt;filltable = FXCollections.observableArrayList();
  
      public void fillTableValues(){
  
          try { 
              Connection con = null;
              PreparedStatement preparedStatement = null;
              ResultSet rs =null;
              con = DBConnection.getDBConnection();
              stock st1 = new stock();
              String query = "select * from stock3"; 
              preparedStatement = con.prepareStatement(query);
              rs = preparedStatement.executeQuery();
              while(rs.next()){   
                int bill12 = rs.getInt("bill");
                String categ12 = rs.getString("categ");
                String name12 = rs.getString("name");
                int qty12 = rs.getInt("qty");
                Double price12 = rs.getDouble("price");
  
                stock st2= new stock();
                             st2.setbill(bill12);
                st2.setcategory(categ12);
                st2.setname(name12);
                st2.setqty(qty12);
                st2.setPrice(price12);
                 filltable.add(new stock(bill12,categ12,name12,qty12,price12));
                tableView.setItems(filltable);
              // tableView.setItems(st2.getbill(),st2.getcategory(),st2.getname(),st2.getqty(),st2.getPrice());
                System.out.println(bill12);
                System.out.println(categ12);
                System.out.println(qty12);
                System.out.println(price12);
                //System.out.println(st2);
              }
          } catch (SQLException ex) {
  
              Logger.getLogger(stockMainController.class.getName()).log(Level.SEVERE, null, ex);
          } catch (ClassNotFoundException ex) {
  
              Logger.getLogger(StockFinalFinal.class.getName()).log(Level.SEVERE, null, ex);
          }       
      }  
  
      @FXML
      private void onSearch(ActionEvent event) {
  
  
              Connection con = null;
              PreparedStatement preparedStatement = null;
              ResultSet rs =null;
              if(search_txt.getText().equals("")){    
                  fillTableValues();
                  JOptionPane.showMessageDialog(null, "Error! No value searched!!");
  
              }else{
                  try {
                   filltable.clear();
                  con = DBConnection.getDBConnection();
  
                  String searchquery = "SELECT * from stock3 where price LIKE '%"+search_txt.getText()+"%'";
                  preparedStatement = con.prepareStatement(searchquery);
                  //preparedStatement.setString(1,search_txt.getText());
                  rs = preparedStatement.executeQuery();
                  //preparedStatement = con.prepareStatement(searchquery);
                  if(rs.next()){
  
  
                  filltable.add(new stock(rs.getInt(2),rs.getString(4)," "+rs.getString(5),rs.getInt(6),rs.getDouble(7)));
  
                  }
                  tableView.setItems(filltable);
  
  
              } catch (ClassNotFoundException ex) {
                  Logger.getLogger(stockMainController.class.getName()).log(Level.SEVERE, null, ex);
              } catch (SQLException ex) {
                  Logger.getLogger(stockMainController.class.getName()).log(Level.SEVERE, null, ex);
              }
          }
      }
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
  
          bill12.setCellValueFactory(new PropertyValueFactory&lt;&gt;("categ"));
          name12.setCellValueFactory(new PropertyValueFactory&lt;&gt;("categ"));
          categ12.setCellValueFactory(new PropertyValueFactory&lt;&gt;("name"));
          qty12.setCellValueFactory(new PropertyValueFactory&lt;&gt;("qty")); 
          price12.setCellValueFactory(new PropertyValueFactory&lt;&gt;("price"));
  
          fillTableValues();
  
  
      }
  
  }
  </code></pre>
  
  <p>This only shows the tablecolumn price, But I want to display all the columns which include <code>String</code> (<code>categ12</code>, <code>name12</code>) and <code>Integer</code> (<code>qty12</code>, <code>bill12</code>). So how can I do it, what should I change?</p>