import java.util.ArrayList;
import java.util.List;

import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class MyApplication extends Application
{
    @Override
    public void start(Stage stage)
    {
        List<Obj> list = createList();
        ObservableList<Obj> rows = FXCollections.observableArrayList(list);
        TableView<Obj> tableView = new TableView<>();
        tableView.setItems(rows);

        TableColumn<Obj, String> myColumn = new TableColumn<>("Column");
        myColumn.setCellValueFactory(new PropertyValueFactory<>(list.get(0).stringProperty().getName()));
        tableView.getColumns().add(myColumn);

        tableView.selectionModelProperty().get().selectedItemProperty().addListener((obs, o, n) ->
        {
            myColumn.setVisible(false);
            myColumn.setVisible(true);
        });

        BorderPane root = new BorderPane(tableView);
        Scene scene = new Scene(root, 500, 200);
        stage.setScene(scene);
        stage.show();
    }

    private List<Obj> createList()
    {
        var list = new ArrayList<Obj>();
        for (int i = 0; i < 1000; i++)
        {
            list.add(new Obj(String.valueOf(i)));
        }
        return list;
    }

    public static class Obj
    {
        private StringProperty string;
        public void setString(String value) { stringProperty().set(value); }
        public StringProperty stringProperty() {
            if (string == null) string = new SimpleStringProperty(this, "string");
            return string;
        }

        public Obj(String string) {
            setString(string);
        }
    }
}