Skip to content

Can't add a Button to a BorderLayout Panel #28

@GoogleCodeExporter

Description

@GoogleCodeExporter
I add a Button to a panel with BorderLayout, and set the 
Button's layout to north, then it will throw error:
this.panel.getSize is not a function
If I change the button to TextField, it works fine.

Code likes below:

public class BorderLayoutTest extends Panel implements DeferredUiCreate{

    public BorderLayoutTest() {
        super( new BorderLayout(), "Border Layout Test");
    }

    @Override
    public void createUI() {
        Button button = new Button( "T");
        button.setLayoutData( new BorderLayoutData( BorderLayout.NORTH));
        Panel panel = new Panel( "Simple Panel");
        panel.setLayoutData( new BorderLayoutData( BorderLayout.CENTER));
        add( button);
        add( panel);
    }

}

Original issue reported on code.google.com by simon...@gmail.com on 30 Apr 2009 at 4:11

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions