File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Grid layout problem

Prady Kural
Greenhorn

Joined: Feb 16, 2011
Posts: 14

I have 5 buttons on grid layout as::


BB
BB
B-

but i want them to be as::


BB
BB
-B


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

Joined: May 03, 2008
Posts: 4531
    
    5

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?
http://download.oracle.com/javase/tutorial/uiswing/layout/index.html


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

Joined: Apr 06, 2010
Posts: 4371
    
    8

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).
 
 
subject: Grid layout problem