private void preview(TableView table, boolean rowname, boolean colname, List<String> lines){
        table.getColumns().clear();
        String[] line = lines.get(0).split("\t");
        int size = line.length;
        if(colname){           
            for(int j = 0; j < size; j++){
                final int n = j;
                TableColumn<ObservableList<String>, String> col  = new TableColumn<>(line[j]);
                col.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<ObservableList<String>,String>, ObservableValue<String>>() {         

                    @Override
                    public ObservableValue<String> call(TableColumn.CellDataFeatures<ObservableList<String>, String> p) {
                        return new SimpleStringProperty(p.getValue().get(n));
                    }
                });
                table.getColumns().add(col);
            }
        }else{
            for(int j = 0; j < size; j++){
                final int n = j;
                TableColumn<ObservableList<String>, String> col  = new TableColumn<>();
                col.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<ObservableList<String>,String>, ObservableValue<String>>() {         

                    @Override
                    public ObservableValue<String> call(TableColumn.CellDataFeatures<ObservableList<String>, String> p) {
                        return new SimpleStringProperty(p.getValue().get(n));
                    }
                });
                table.getColumns().add(col);
            }
        }
       
        ObservableList<ObservableList<String>> ss = FXCollections.observableArrayList();
        for(int i = 0; i < lines.size(); i++){           
            if(colname && i == 0) continue;
            String[] l = lines.get(i).split("\t");
            ObservableList<String> s = FXCollections.observableArrayList(l);
            ss.add(s);
        }
              
        table.setItems(ss);
    }