Search in sources :

Example 1 with MergedTableView

use of com.kyj.fx.voeditor.visual.component.grid.MergedTableView in project Gargoyle by callakrsos.

the class MergedTableViewExam method start.

/**
	 * @inheritDoc
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    MergedTableView<String> root = new MergedTableView<>();
    TableColumn<String, String> e = new TableColumn<>("sample");
    e.setCellValueFactory(param -> {
        String value = param.getValue();
        return new SimpleStringProperty(value);
    });
    e.setCellFactory(MergedTextFieldTableCell.forTableColumn());
    root.getColumns().add(e);
    Random random = new Random(10);
    for (int i = 0; i < 100; i++) {
        root.getItems().add(String.valueOf(random.nextInt(10)));
    }
    //		
    primaryStage.setScene(new Scene(root));
    primaryStage.show();
}
Also used : Random(java.util.Random) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) MergedTableView(com.kyj.fx.voeditor.visual.component.grid.MergedTableView)

Aggregations

MergedTableView (com.kyj.fx.voeditor.visual.component.grid.MergedTableView)1 Random (java.util.Random)1 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)1 Scene (javafx.scene.Scene)1 TableColumn (javafx.scene.control.TableColumn)1