I try to create form class in GXT 2.2.4, but it doesn't work properly.

Here is form code:
Code:
public class TestForm extends FormPanel {
    
    public TestForm() {
        setHeading("TestForm"); 
    }
    
    @Override
    protected void onRender(Element parent, int pos) {
        super.onRender(parent, pos);


            setFrame(true);  //This doesn't work
            setCollapsible(true); 
            setWidth(300); //This crashes UI
             
            final TextField<String> firstName = new TextField<String>();  
            firstName.setFieldLabel("First Name *");  
            firstName.setAllowBlank(false);  
            add(firstName);  
          
            final TextField<String> lastName = new TextField<String>();  
            lastName.setFieldLabel("Last Name *");
            lastName.setAllowBlank(false);  
            add(lastName);  
            
            Radio radio1 = new Radio();  
            radio1.setBoxLabel("Male");  
            radio1.setValue(true);  
          
            Radio radio2 = new Radio();  
            radio2.setBoxLabel("Female");
          
            final RadioGroup rgGender = new RadioGroup();  
            rgGender.setFieldLabel("Gender *");  
            rgGender.add(radio1);  
            rgGender.add(radio2);  
            rgGender.setSelectionRequired(true);
            add(rgGender);  


            final Button btnSearch = new Button("Search");
            addButton(btnSearch);  //This doesn't work


            Button btnClear = new Button("Clear");
            btnClear.addSelectionListener(new
                    SelectionListener<ButtonEvent>() {
                        public void componentSelected(ButtonEvent ce) {
                            reset();
                        }
                });
            
            addButton(btnClear);  //This doesn't work
    }


}
In this code setFrame and addButton methods doesn't work. setWidth metod crashes UI.

So how can I create form class correctly?


And here is entry point code:
Code:
private final VerticalPanel formPanel = new VerticalPanel();
@Override
public void onModuleLoad() {    


    Viewport viewport = new Viewport();
    viewport.setLayout(new RowLayout(Orientation.HORIZONTAL));


    formPanel.add(new TestForm());


    formPanel.setSpacing(10); 
    viewport.add(formPanel);


    RootPanel.get("gwtcontent").add(viewport);
}