• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

GridBag Layout ( Basic fundas)

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

fill specifies how to let the component expand to fill any extra space.
So, I think the answer is 1.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think 1 and 4 are right..
correct me if I am wrong..
Ramani.
 
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 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.
 
ramani2020
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic