I am posting this question based on many similar questions asked in different mock tests. Which of the following is True about GridBagLayout: 1. If a component has been given Fill BOTH is it true that component resizes when container resizes. 2. The number of rows and columns are fixed while loading components. 3. The no. of rows and columns are fixed while loading layout itself. 4. If component has a non zero weighty then component grows in height as the container is resized
I'm not very sure abt this but aren't 1, 2 and 4 right? 1 is definitely right. 4 also is right. Isn't 2 also right? When the component is loaded the no. of rows and columns are decided by the gridwidth and gridheight variables in the GridBagConstraints instance.
Joined: Sep 14, 2000
Satish,The gridwidth and gridhieght parameters indicate the number of cells allotted to the component horizontally and vertically .I dont think they decide the number of rows and columns. could somebody come up with the correct answer,please? thanks, Ramani.