String captions[] = new String[] { "TextField with caption", null };
Resource icons[] = new Resource[] {
new ThemeResource("icons/16/document-delete.png"), null };
boolean required[] = new boolean[] { true, false };
TextField fields[][] = new TextField[captions.length][icons.length];
for (int caption = 0; caption < captions.length; caption++) {
for (int icon = 0; icon < icons.length; icon++) {
for (int req = 0; req < required.length; req++) {
TextField tf = createTextFieldWithError(captions[caption],
icons[icon], required[req]);
fields[caption][icon] = tf;
if (componentWidth != null) {
tf.setWidth(componentWidth);
tf.setValue(tf.getValue() + " w:" + componentWidth);
}
if (componentHeight != null) {
tf.setHeight(componentWidth);
tf.setValue(tf.getValue() + " h:" + componentHeight);
}
newLayout.addComponent(tf);
if (align) {