Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me with alignment. GridBagLayout

 
Lisa Abraham
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> 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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47288
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic