title: Editing Table Cell using Java
body: <p>I have a table with a column. Initially, the table is blank. I need to enter values at cell like Excel. I followed the question <a href="https://stackoverflow.com/questions/24732883/javafx-table-cell-editing">javafx-table-cell-editing</a> and also JAVA Tutorial on TableView.</p>
  
  <p>I coded like:</p>
  
  <pre><code>colCom1.setCellValueFactory(new PropertyValueFactory&lt;&gt;("C1"));
  colCom1.setCellFactory(TextFieldTableCell.forTableColumn ());
  colCom1.setOnEditCommit(new EventHandler&lt;TableColumn.CellEditEvent&lt;commonDataClass, String&gt;&gt;() {
          @Override
          public void handle(TableColumn.CellEditEvent&lt;commonDataClass, String&gt; t) {
              ((commonDataClass) t.getTableView().getItems().get(
                      t.getTablePosition().getRow())).setD1(t.getNewValue().toString());           
                  tC1.setItems(myC1);
                  System.out.println("Col1-&gt;" + colCom1.isVisible());
                  tC1.refresh();
                  tC1.setVisible(true);
              }
          }
      });
  </code></pre>
  
  <p><em>The issue I am facing is that after editing and pressing "ENTER" nothing appears in the cell (cell remains blank) while printing of data reveals that value has been properly entered.</em> </p>