For example, if you have code:
JCheckBox checkBox| = new JCheckBox("Click here");
panel.add(checkBox);
press Ctrl-Alt-T, choose "if" or "if/else", and - voila:
JCheckBox checkBox;
if(~|) {
checkBox = new JCheckBox("Click here");
}
panel.add(checkBox);