如何更改单元格中的文本(ControlsFX 的 SpreadsheetView)?
How to change text in cells (SpreadsheetView by ControlsFX)?
我的程序中有 SpreadsheetView class:
SpreadsheetView table;
gridBase = new GridBase(rowCount, columnCount);
ObservableList<ObservableList<SpreadsheetCell>> rows = FXCollections.observableArrayList();
for (int row = 0; row < gridBase.getRowCount(); ++row) {
final ObservableList<SpreadsheetCell> list = FXCollections.observableArrayList();
for (int column = 0; column < gridBase.getColumnCount(); ++column) {
SpreadsheetCell cell = SpreadsheetCellType.STRING.createCell(row, column, 1, 1, "value");
list.add(cell);
}
rows.add(list);
}
gridBase.setRows(rows);
table = new SpreadsheetView(gridBase);
我可以创建单元格:
SpreadsheetCell cell = SpreadsheetCellType.STRING.createCell(row, column, 1, 1, "value");
但我无法重写此单元格中的文本。我该怎么做?
// set item in 6th row and 8th column
gridBase.setCellValue(5, 7, "Hello World");
我的程序中有 SpreadsheetView class:
SpreadsheetView table;
gridBase = new GridBase(rowCount, columnCount);
ObservableList<ObservableList<SpreadsheetCell>> rows = FXCollections.observableArrayList();
for (int row = 0; row < gridBase.getRowCount(); ++row) {
final ObservableList<SpreadsheetCell> list = FXCollections.observableArrayList();
for (int column = 0; column < gridBase.getColumnCount(); ++column) {
SpreadsheetCell cell = SpreadsheetCellType.STRING.createCell(row, column, 1, 1, "value");
list.add(cell);
}
rows.add(list);
}
gridBase.setRows(rows);
table = new SpreadsheetView(gridBase);
我可以创建单元格:
SpreadsheetCell cell = SpreadsheetCellType.STRING.createCell(row, column, 1, 1, "value");
但我无法重写此单元格中的文本。我该怎么做?
// set item in 6th row and 8th column
gridBase.setCellValue(5, 7, "Hello World");