This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I would say A,B are correct. A - I remember reading this somewhere. B - because setting the fill field to BOTH would cause the component to stretch to fill its display area thus the anchor value would have no effect on the component.
Hi Sherin, The correct ans is B. When u set fill=BOTH, there is no point in specifying anchor as the component will occupy all the space available to it when it is resized. C is incorrect b'coz the inverse of the statement is true. Pls correct me if i'm wrong. Raghu
Joined: Sep 03, 2000
A is incorrect as weightx and weighty can have any double value. The effect of having weightx=2 and weighty=4 is the same as weightx=100 and weighty=200 as the relative value of weightx and weighty is considered.
only b is right. a is wrong because it is not the case always and is not compusary... c is wrong because eventhough you have set the anchor field you can always fill the cell and that will impact the layout of the component