It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes Grid layout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Grid layout problem" Watch "Grid layout problem" New topic

Grid layout problem

Prady Kural

Joined: Feb 16, 2011
Posts: 14

I have 5 buttons on grid layout as::


but i want them to be as::


how to do , if possible please write code.
Darryl Burke

Joined: May 03, 2008
Posts: 5115

1. The problem isn't apparent. Post any ASCII art it code tags so it retains its alignment

2. This is a forum, NotACodeMill. It's up to you to post your code and ask any specific question about it.

Have you gone through the tutorial for layouts?

luck, db
There are no new questions, but there may be new answers.
Matthew Brown

Joined: Apr 06, 2010
Posts: 4543

Look at the ComponentOrientation property of the container in question - that affects how the GridLayout works. Or, you could just stick a blank component into the gap (e.g. an empty JPanel).
I agree. Here's the link:
subject: Grid layout problem
It's not a secret anymore!