Sunday, May 10, 2009

IndexOutOfBoundsException: Column index: 1, Column size: 1

java.lang.IndexOutOfBoundsException: Column index: 1, Column size: 1


So, apparently, this is the error you get when you try to add a widget to a cell in a Grid that does not exist. Serves me right!


Changing the Grid to 5,2 instead of 5,1 worked. I guest the method setWidget is zero based, but the Grid constructor in ordinal.


final VerticalPanel panel = new VerticalPanel();

        final Grid grid = new Grid(5, 2);

        grid.setWidget(0, 0, new Label("Query"));
        TextArea queryTextArea = new TextArea();

        grid.setWidget(0, 1, queryTextArea);

No comments:

Post a Comment