Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Resizing grids in GridLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Resizing grids in GridLayout" Watch "Resizing grids in GridLayout" New topic
Author

Resizing grids in GridLayout

Marco Galea
Ranch Hand

Joined: Mar 30, 2011
Posts: 30
Hi,
I was wondering if it is possible to specify the exact grid height (or else something as setSize()) when using a GridLayout ??
I manage to put components in a GridLayout so as to keep my preferred sizes by first putting them in a JPanel and then in a gridLayout panel, but still the problem is that between a component from a grid to the other, the height is not my liking...... so i was wondering if i could actually change the size of a grid.

I know i could use gridbaglayout but want to see if possible with this layout.

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

The API Documentation wrote:The GridLayout class is a layout manager that lays out a container's components in a rectangular grid. The container is divided into equal-sized rectangles, and one component is placed in each rectangle.
Marco Galea
Ranch Hand

Joined: Mar 30, 2011
Posts: 30
Paul Clapham wrote:
The API Documentation wrote:The GridLayout class is a layout manager that lays out a container's components in a rectangular grid. The container is divided into equal-sized rectangles, and one component is placed in each rectangle.


Cheers...so i definately understood it correctly.......

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Resizing grids in GridLayout