aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Help me with alignment. GridBagLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help me with alignment. GridBagLayout" Watch "Help me with alignment. GridBagLayout" New topic
Author

Help me with alignment. GridBagLayout

Lisa Abraham
Greenhorn

Joined: Aug 16, 2012
Posts: 4
hi. i want to align heading to the top centre and i want to align rest of my fields and labels to the left after heading. i have tried alot but cant do it.

i want to do it like this


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> i have tried alot but cant do it.

your post reads (to me) like a 'please fix this', but that's not how this site operates.

you need to (at least) have your posted code display all the components in their unaligned positions,
then we can make suggestions for improvement.
Lisa Abraham
Greenhorn

Joined: Aug 16, 2012
Posts: 4
First of all, i would like to set these two in alignment. If i can know how to set these two, then i can do remaning by myself. Please help me with this. that how can i allign these two options that have added.
JLabel and JTextField
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38765
    
  23
Welcome to the Ranch

Before messing around with grid bag, you should find out about Cai Horstmann’s GBC class, which there is a link to in this post.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4540
    
    5

1. Follow standard Java coding conventions. Variable names start with a lowercase letter.

2. Have you gone through the Oracle tutorial on GridBagLayout?

edit 3. Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/62317-help-me-alignment-gridbaglayout.html


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me with alignment. GridBagLayout