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

Grid layout

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In this code,a layout manager of 3 rows and 1 column is created and 5 buttons are added to it.
When I run this application,I find 3 buttons in the first row,and 2 buttons in the second with the space for a third button left.Now I understand why this happens,its because GridLayoutManager is row major and it has to strictly adhere to the number of rows specified,unless it is 0.But couldn't it have placed four buttons in the top row and 1 in the 2nd row.How will we determine how many buttons are placed in the top row and how many in the bottom row?
 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Gautam
I think, this link may help you
Layout Managers
P.S. I studied LayoutManagers from this site during my SCJP prep.
Regards,
Jamal Hasanov
www.j-think.com
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gautam,
Your last chance don't forget to check javacertstudy in yahoo groups(Treasure is not hidden - open source code in messages section). Good Luck for your Exams Tomorrow.

-Arun
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic