title: Multi Line editable cell in tableview javafx
body: <p>Hi I just want multi line cell in JavaFX which is editable.</p>
  
  <pre><code>@FXML
  private TableColumn bookName;
  
    @Override
    public void initialize(URL url, ResourceBundle rb) {
          tableView.setEditable(true);
          //      setCellFactory();   
          bookName.setCellFactory(TextFieldTableCell.forTableColumn()); // If I comment this line and uncomment above line then cell will be multiline but not editable
          bookName.setOnEditCommit(
                  new EventHandler&lt;TableColumn.CellEditEvent&lt;Books, String&gt;&gt;() {
              @Override
              public void handle(TableColumn.CellEditEvent&lt;Books, String&gt; t) {
  
  
                  if (t.getNewValue().equals("") || t.getNewValue().length() &lt; 3) {
                      info.setText("Book name must be greater than 3 characters.");
                      ((Books) t.getTableView().getItems().get(
                              t.getTablePosition().getRow())).setBookName(t.getOldValue());
                      return;
  
                  }
  
                  ((Books) t.getTableView().getItems().get(
                          t.getTablePosition().getRow())).setBookName(t.getNewValue());
              }
          });
  
      }
  </code></pre>
  
  <p>If I set custom cellFactory, cell will be multiline but not editable</p>
  
  <pre><code>private void setCellFactory() {
  
          Callback&lt;TableColumn, TableCell&gt; cellFactory = new Callback&lt;TableColumn, TableCell&gt;() {
              @Override
              public TableCell call(TableColumn param) {
                  final TableCell cell = new TableCell() {
                      private Text text;
  
                      @Override
                      public void updateItem(Object item, boolean empty) {
                          super.updateItem(item, empty);
                          if (!isEmpty()) {
                              text = new Text(item.toString());
                              text.setWrappingWidth(140);
                              setGraphic(text);
                          }
                      }
                  };
                  return cell;
              }
          };
  
          bookName.setCellFactory(cellFactory);
      }
  </code></pre>
  
  <p>Not editable multiline cell.
  <img src="https://i.stack.imgur.com/2hhDq.png" alt="enter image description here"></p>