Could somebody help me with this? It's from Applied reasoning mock exam? A panel has grid layout with 2 rows and 2 columns. there is a button in each cell and another button is added to the pnale as follows:- aPanel.addbutton(new button("Bob")). Where will the new button be placed? A. row1 col3 B. row1 col1 C. row3 col1 D. row2 col3 E. row2 col2 I marked "A" as the number rows remains the same and columns can be increased. But the correct answer was "E". I am confused???
Hi When you add an additional component to the grid layout an additional column will be added.So in your question by default you have 2 rows 2 columns..so it will be something like button1 button2 button3 button4 Now when you add an additional button,what happens(???) you will have an addtional column,so now we have 2 rows 3 columns,so now how do you think the buttons will adjust themselves button1 button2 button3 button4 button5 So whats your answer now Surya [This message has been edited by Surya B (edited August 29, 2000).]
For GridLayout No of rows has higher priority and is enforced. If the no of rows is 0, then the no of columns is enforced. Maybe I'm terse with this one cos' it's mentioned in API and u can try some code to see it in real.... Thanks.