wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Grid layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Grid layout" Watch "Grid layout" New topic

Grid layout

Gautam Sewani
Ranch Hand

Joined: Apr 19, 2002
Posts: 93

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?
Jamal Hasanov
Ranch Hand

Joined: Jan 08, 2002
Posts: 411
Hi, Gautam
I think, this link may help you
Layout Managers
P.S. I studied LayoutManagers from this site during my SCJP prep.
Jamal Hasanov
Arun Pai
Ranch Hand

Joined: Mar 11, 2002
Posts: 143
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.

I agree. Here's the link: http://aspose.com/file-tools
subject: Grid layout
It's not a secret anymore!