I have a class called Result (data that I want to show in my table) with several attributes.
public class Result
{
    private final SimpleStringProperty object;
    private List<SimpleStringProperty> listObject= new ArrayList<SimpleStringProperty>();
    private final Util util = new Util();
    public Result(String object, String[] listObject)
    {
    this.object= new SimpleStringProperty(object);
    this.objectList= util.transformar(listObject);
    }
    public String getObject()
    {
    return this.object.get();
    }
    public void setObject(String object)
    {
    this.hash.set(hash);
    }
    public String[] getListObject()
    {
    return util.transformar2(this.listObject);
    }
    public void setListObject(String[] listObject)
    {
    this.listObject= transformar(listObject);
    }
}
And I have my controller where I have an empty table and I add the columns and the objetcs Result. The controller has the attribute:
@FXML
private TableView tablaResultado;
The method were I do that is:
 private List<TableColumn> load()
    {
    List<TableColumn> listColumn = new ArrayList<TableColumn>();
    Object2 object2= new Object2();
    List<Result> listaResultado = object2.getResultado();
    ObservableList<Result> prueba = FXCollections
        .observableArrayList(listaResultado);
    TableColumn<Result, String> object= new TableColumn<Result, String>("object");
    direccion.setCellValueFactory(
        new PropertyValueFactory<Result, String>(
            "object"));
    listColumn.add(object);
    List<TableColumn<Result, String>> listObject = new ArrayList<TableColumn<Result, String>>();
    for (int i = 0; i < ((Result) listaResultado
        .get(0)).getListObject().length; i++)
    {
        TableColumn<Result, String> columna = new TableColumn<Result, String>(
            this.lenguaje.getProperty("listObject"+i);
        columna.setCellValueFactory(
            new PropertyValueFactory<Result, String>(
                "listObject[" + i + "]"));
        objectList.add(columna);
    }
    listColumn.addAll(objectList);
        ObservableList<TableColumn<Result, String>> prueba2 = FXCollections
            .observableArrayList(listObject);
        this.tablaResultado.setItems(prueba);
       this.tablaResultado.getColumns().addAll(object);
        for (int i = 0; i < prueba2.size(); i++)
        {
        this.tablaResultado.getColumns().addAll(prueba2.get(i));
        }
        }
    return listColumn ;
The result is the columns with their names and the data in the column object but the data in the columns listObject is empty. It has to be a list or something because I don't know the size of listObject.
If I change:
columna.setCellValueFactory(new PropertyValueFactory<Result, String ("listObject[" + i + "]"));
and I write:
columna.setCellValueFactory(new PropertyValueFactory<Result, String ("listObject"));
I got something like Ljava.lang.String;@bda3303 in that columns.
 
     
     
    