Checkbox as border title

Hello,

Is there any chance to create a border and placing a checkbox in the border, in general a combonent title border ! Please check the figure to know what exactly I mean !

Inside that I need to place two datepicker, and I need to enable/disable that depends on the checkbox state !

Please help me !
12532.png

You can try to do this using CustomLayout:

CustomLayout cl = null;
try {
	cl = new CustomLayout(new ByteArrayInputStream("<fieldset><legend location='legend'></legend><div location='content'></div></fieldset>".getBytes()));
} catch (IOException e) {
	// CATCH EXCEPTION
}
if (cl != null) {
	cl.setSizeUndefined();
	cl.addComponent(new CheckBox("checkbox"), "legend");
	cl.addComponent(new Button("content button"), "content");
}

(I’ve attached an image which shows the result)

Of course you can do it more elegantly by creating a separate template as it is described in this article:
CustomLayout

12535.jpg