JCheckBox checkBox = new JCheckBox(); checkBox.setText("Option 1");
JCheckBox checkBox = new JCheckBox("Option 2");
JCheckBox checkBox = new JCheckBox(); checkBox.setText("Option 3"); checkBox.setSelected(true);This code creates a new checkbox, sets the label to "Option 3", and selects the checkbox by default. In all these examples, the `JCheckBox` class is imported from the `javax.swing` package library.