// Create a new workbook Workbook workbook = new Workbook(); IWorksheet ws = workbook.getWorksheets().get("Sheet1"); // Simple usage ws.getRange("B2").setValue("The GroupBox control provides a titled container for contents."); IGroupBox groupBox1 = ws.getControls().addGroupBox(23.45, 49.9, 174, 50.1); groupBox1.setText("Group 1"); // Group multiple option buttons. ws.getRange("B9").setValue("A GroupBox can group multiple option buttons."); IRange e12 = ws.getRange("E12"); e12.setValue(1d); ws.getRange("A:A").setColumnWidthInPixel(25d); IGroupBox groupBox2 = ws.getControls().addGroupBox(23.55, 153.6, 136.39, 116.4); groupBox2.setText("Group 2"); IOptionButton optionButton3 = ws.getControls().addOptionButton(42.75, 170.4, 97.7, 15.79); optionButton3.setLinkedCell(e12); optionButton3.setIsChecked(true); ws.getControls().addOptionButton(42.75, 201, 97.7, 17.69); IOptionButton optionButton5 = ws.getControls().addOptionButton(42.75, 235.2, 97.7, 17); optionButton5.setDisplay3DShading(true); // Save to an excel file workbook.save("GroupBoxesBasicUsage.xlsx");