No, because headerCount is set to the length of the array. You'll just skip the first element.
Ian http://examples.roughian.com 2009/11/13 Davis Ford <[email protected]> > Yep - and as a result, you probably generate an > ArrayIndexOutOfBoundsException when you dereference the last element past > the array's length. GWT will show this exception in the hosted mode log > status window, but in the view, you'll just see the first row, and not the > second. > > > On Fri, Nov 13, 2009 at 11:35 AM, Ian Bambury <[email protected]>wrote: > >> The only thing wrong with the code is that the second loop skips the 'h1' >> element because you have int i=1 and not int i=0 >> >> Ian >> >> http://examples.roughian.com >> >> >> 2009/11/13 JAppetta <[email protected]> >> >> I know that I'm missing something basic here (possibly stressed out >>> due to impending demo :) but I can't see why my second row is not >>> being added to the table: >>> >>> [code] >>> String[] platformHeaders ={ "p1","p2","p3", >>> "p4", "p5","p6", "p7", "p8"}; >>> >>> >>> String[] buildHeaders = {"h1", "h2","h3", "h4","h5", >>> "h6", "h7","h8"}; >>> >>> >>> >>> FlexTable buildTable = new FlexTable(); >>> >>> int headerCount = buildHeaders.length; >>> int headerCountP = platformHeaders.length; >>> >>> >>> for (int i =0; i < headerCountP; i++) >>> buildTable.setText(0, i, platformHeaders[i]); >>> >>> for (int i =1; i < headerCount; i++) { >>> buildTable.setText(1, i, buildHeaders[i]); >>> >>> [/code] >>> >>> Thanks! >>> >>> -- >>> >>> You received this message because you are subscribed to the Google Groups >>> "Google Web Toolkit" group. >>> To post to this group, send email to [email protected] >>> . >>> To unsubscribe from this group, send email to >>> [email protected]<google-web-toolkit%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/google-web-toolkit?hl=. >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-web-toolkit%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=. >> > > > > -- > Zeno Consulting, Inc. > home: http://www.zenoconsulting.biz > blog: http://zenoconsulting.wikidot.com > p: 248.894.4922 > f: 313.884.2977 > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.
