title: ComboBox in a tableview cell in JavaFX
body: <p>I'm trying to a add a <code>Combo Box</code> to my <code>Table View</code>:</p>
  
  <p>Basically I have a class called TableViewTest that stores a name and a description, I can display theses names and descriptions in a <code>Table View</code> no bother, but what I want to do is add a third column with each cell having a <code>Combo Box</code> so that the user can select one from a number of options for each person. </p>
  
  <p>So far I have created an <code>ObservableList</code> of type <code>String</code> with some values and added them to a <code>ComboBox</code> object. Does anyone know a way for me to add this <code>Combo Box</code> to the table?</p>
  
  <p>Also bear in mind this code is pretty rough and I'm just trying to get something working and I'll be refactoring the code at a later date.</p>
  
  <pre><code>ObservableList&lt;TableViewTest&gt; products = FXCollections.observableArrayList();
  
      for(int i = 0; i &lt; b.length; i++){
  
          // random String values
          products.add(new TableViewTest(b[i], a[i]));
      }
  
  ObservableList&lt;String&gt; options = FXCollections.observableArrayList(
                                  "1",
                                  "2",
                                  "3"
                                  );
  final ComboBox comboBox = new ComboBox(options);
  
  TableColumn&lt;TableViewTest, String&gt; nameColumn = new TableColumn&lt;&gt; ("Name");
  nameColumn.setMinWidth(200);
  nameColumn.setCellValueFactory(new PropertyValueFactory&lt;TableViewTest, String&gt;("name"));
  
                  //price Column
                  //Stock Column
  TableColumn&lt;TableViewTest, String&gt; StockColumn = new TableColumn&lt;&gt; ("Stock");
  StockColumn.setMinWidth(150);
  StockColumn.setCellValueFactory(new PropertyValueFactory&lt;TableViewTest, String&gt;("description"));
  
  
  TableColumn&lt;Object,ComboBox&gt; PriceColumn;
  PriceColumn = new TableColumn&lt;&gt;("Source");
  PriceColumn.setMinWidth(150);
     //PriceColumn.setCellValueFactory(new PropertyValueFactory&lt;&gt;
     //(options));
  
     //PriceColumn.setCellFactory(ComboBoxTableCell.forTableColumn(new 
     //DefaultStringConverter(), options));
  
  
     //PriceColumn.setCellFactory(ComboBoxTableCell.forTableColumn( 
     //comboBox));
  
  TableView&lt;TableViewTest&gt; table = new TableView&lt;&gt;();
  
  table.setItems(products);
  table.getColumns().addAll(nameColumn, StockColumn, PriceColumn);
  </code></pre>