Is anyone out there familiar with a way to lock a row in a spreadsheet created with Apache POI 3.7? By locking I mean that I want the title row for the columns to remain visible
To do this, you can create a freeze pane as follows:
workbook.getSheetAt(workbook.getActiveSheetIndex()).createFreezePane(0, 1);
This will freeze the first row in place. There's another method with more options, so check out the API.
The only thing to note would be if you're using XSSF workbooks - there is a mention of a bugfix in version 3.8-beta3 that fixed the behavior of freeze panes using XSSF spreadsheets:
50884 - XSSF and HSSF freeze panes now behave the same(poi-developers)
I don't know the details of this, but it would be worth investigating if you're in that boat.