Checkbox value in layout

I have the following:

		 cb = new CheckBox();
		[b]

cb.setValue(true);
[/b]
label = new Label(text);
tf = new TextField();
tf.setInputPrompt(“Add Name”);

		label.setContentMode(Label.CONTENT_XHTML);
		

		layout.addComponent(cb);

		layout.addComponent(label);
		layout.addComponent(tf);

When this displays in the screeen, the checkbox is unmarked even though I marked it as true above.

Not sure what the issue is here

There is no issue for my code:

	   	// add checkbox
	   	CheckBox checkBox = new CheckBox("Select all");
	   	checkBox.setValue(true);
	   	layout.addComponent(checkBox);