• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

GRIDBAG LAYOUT

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic