Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Gridbay Constraints

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In GridBagConstraints, if fill=fill.BOTH is selected, which variables listed below are irrelevant?
a.anchor
b.ipadx
c.insets
d.weightx
I feel that it should be anchor, since fill and anchor do not
go together. Am i right?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm going to have to agree with your answer of Anchor because if fill is set to BOTH, then the component will strech to fill the entire area and anchoring will have no effect regards of its value.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to suggest that both Anchor and ipadx are valid answers. The effect of setting GridBagConstraints'fill equal to fill.BOTH makes the component fill its display area entirely.
Since the anchor field is used when the component is smaller than its display area (not the case when fill=fill.BOTH), this answer sounds reasonable to me.
The field ipadx (and ipady) are used to specify the number of pixels to be added to the component's minimum size. With the fill field set to fill.BOTH, aren't we assured that the component's minimum size is irrelevent?
 
They weren't very bright, but they were very, very big. Ad contrast:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic