Last active
February 15, 2026 06:03
-
-
Save aspose-com-kb/0dfd96e8ec970bd76a4f2052de2013d9 to your computer and use it in GitHub Desktop.
Add Check Mark in Excel using Java. For details: https://kb.aspose.com/cells/java/add-check-mark-in-excel-using-java/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.aspose.cells.*; | |
| public class CheckMarkDemo { | |
| public static void main(String[] args) throws Exception { | |
| // Apply Aspose.Cells license | |
| License license = new License(); | |
| license.setLicense("license.lic"); | |
| insertTickSymbol(); | |
| } | |
| public static void insertTickSymbol() throws Exception { | |
| // Load or create a workbook | |
| Workbook workbook = new Workbook(); | |
| Worksheet sheet = workbook.getWorksheets().get(0); | |
| // Method 1: Use Unicode tick (✓ U+2713) | |
| Cell a1 = sheet.getCells().get("A1"); | |
| a1.putValue("\u2713"); // Insert Unicode tick | |
| Style styleA1 = a1.getStyle(); | |
| styleA1.getFont().setName("Segoe UI Symbol"); // Font that supports ✓ | |
| a1.setStyle(styleA1); | |
| // Method 2: Insert a checkbox instead of a static symbol | |
| int index = sheet.getCheckBoxes().add(2, 0, 20, 100); | |
| com.aspose.cells.CheckBox checkBox = sheet.getCheckBoxes().get(index); | |
| checkBox.setValue(true); // Checked by default | |
| checkBox.setText("Checked"); | |
| // Save the workbook | |
| workbook.save("output_with_checkmarks.xlsx"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment