Hi,
I realise that this in many ways runs counter to the use-case for SpreadsheetView, but I thought I'd ask anyway:
I've got a SpreadsheetView with several columns in it, which when the application is default size are wider than the parent container, and trigger a scroll. This is fine, and I'm happy with this, but when I maximise the application, I'd like the rows to automatically resize the width of the parent, rather that staying the same size. I'm initialising the component as follows:
private void buildAgencySpreadSheetView() {
GridBase grid = new GridBase(dataList.size(), 7);
spreadsheetView = new SpreadsheetView(grid);
spreadsheetView.setShowRowHeader(true);
spreadsheetView.setShowColumnHeader(true);
spreadsheetView.setEditable(true);
spreadsheetView.getColumns().get(0).setPrefWidth(120);
spreadsheetView.getColumns().get(1).setPrefWidth(120);
spreadsheetView.getColumns().get(2).setPrefWidth(200);
spreadsheetView.getColumns().get(3).setPrefWidth(350);
spreadsheetView.getColumns().get(4).setPrefWidth(350);
spreadsheetView.setFixingColumnsAllowed(true);
spreadsheetView.resizeRowsToMaximum();
borderPane.setCenter(spreadsheetView);
}Looking at some other examples, it seemed that I would have better luck with not setting
prefWidth, but this doesn't resize the columns to fit the data when I add it later (lots of ... going on, and the columns are all about 100 wide).
Is there a means by which the columns can be made to auto resize, and if not, what is the best approach for implementing it?
Thanks