java - How to add a Button in the SpreadsheetView table -


how can create object(button,checkbox) in table?

    gridbase grid = new gridbase(20, 20);      observablelist<observablelist<spreadsheetcell>> rows = fxcollections.observablearraylist();     (int row = 0; row < grid.getrowcount(); ++row) {         final observablelist<spreadsheetcell> list = fxcollections.observablearraylist();         (int column = 0; column < grid.getcolumncount(); ++column) {             list.add(new objecttype().createcell(row, column, 1, 1, new button("click")));         }         rows.add(list);     }     grid.setrows(rows);     spreadsheetview spv = new spreadsheetview(grid); 

output in table:

button@79280814[styleclass=button]'click'

button@3ad2325d[styleclass=button]'click'

i think have found :)

1-)

 spreadsheetcellbase cell = new spreadsheetcellbase(row, column, 1, 1);                          cell.setgraphic(new button("test button"));                          list.add(cell) 

2-)

spreadsheetcell cellindex = spreadsheetcelltype.string.createcell(row, column, 1, 1,null);                       cellindex.setgraphic(new button("test button"));                      cells.add(cellindex); 

Comments