size field form help

Hello:

Vaadin automatically generates the form fields to change the size of a specific field write the following

Field field=this.myForm.getField("name Field");
field.setWidth("310px");
this.myForm.addField("nombre Field", field);

 is correct or not I use  FormFieldFactory  to change the width of the fields???:(:(:(:(:(:(:(:(: