// Create a new workbook Workbook workbook = new Workbook(); IWorksheet ws = workbook.getWorksheets().get("Sheet1"); // Option buttons are usually grouped by different group boxes. String rngB2 = "Option buttons are usually grouped by linked cells and group boxes."; ws.getRange("B2").setValue(rngB2); ws.getRange("B13:C13").setValue(new Object[][] { { "Value", 1d} }); ws.getRange("E13:F13").setValue(new Object[][] { { "Value", 2d} }); ws.getRange("A:A").setColumnWidthInPixel(37d); IGroupBox group1 = ws.getControls().addGroupBox(29.75, 48.2, 136.5, 113.99); group1.setText("Group 1"); IOptionButton optionButton1 = ws.getControls().addOptionButton(39.45, 67.1, 78, 15.60); optionButton1.setLinkedCell(ws.getRange("C13")); optionButton1.setIsChecked(true); IOptionButton optionButton2 = ws.getControls().addOptionButton(39.45, 97.5, 78, 17.40); optionButton2.setLinkedCell(ws.getRange("C13")); IOptionButton optionButton3 = ws.getControls().addOptionButton(39.45, 131.2, 78, 17.5); optionButton3.setLinkedCell(ws.getRange("C13")); IGroupBox group2 = ws.getControls().addGroupBox(191.95, 48.2, 136.5, 113.99); group2.setText("Group 2"); IOptionButton optionButon4 = ws.getControls().addOptionButton(200.35, 65.7, 117.6, 18.5); optionButon4.setLinkedCell(ws.getRange("F13")); IOptionButton optionButton5 = ws.getControls().addOptionButton(200.35, 95.99, 117.6, 21.28); optionButton5.setLinkedCell(ws.getRange("F13")); optionButton5.setIsChecked(true); IOptionButton optionButton6 = ws.getControls().addOptionButton(200.35, 129.2, 117.6, 21.40); optionButton6.setLinkedCell(ws.getRange("F13")); // Save to an excel file workbook.save("OptionButtonsBasicUsage.xlsx");