wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes GRIDBAG LAYOUT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "GRIDBAG LAYOUT" Watch "GRIDBAG LAYOUT" New topic
Author

GRIDBAG LAYOUT

sheri
Ranch Hand

Joined: Sep 14, 2000
Posts: 43
HI ALL

Choose the correct statement about gridbag layout:
A: The weightx & weighty should have values between 0.0 & 1.0

B:If you specify the fill field is BOTH, there is no meaning to set anchor field


C:If you specify anchor field there is no meaning to set fill field is BOTH
CAN ANYBODY PLEASE HELP
THANKS IN ADVANCE
SHERIN
J. Macha
Greenhorn

Joined: Sep 14, 2000
Posts: 12
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.
raghurajput
Greenhorn

Joined: Sep 03, 2000
Posts: 7
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
raghurajput
Greenhorn

Joined: Sep 03, 2000
Posts: 7
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.
Aru
Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Hi,
I agree with Raghu, for B & C.
for A....The API just says that the default value of weightx & weighty is zero & should be a positive.
So A is FALSE.
Aruna
Sagar Sharma
Ranch Hand

Joined: Aug 31, 2000
Posts: 92
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
 
Don't get me started about those stupid light bulbs.
 
subject: GRIDBAG LAYOUT
 
Similar Threads
fill and anchor
GridBagLayout
GridBagLayout
GridBagLayout
Gridbag layout