• Post Reply Bookmark Topic Watch Topic
  • New Topic

GridBagLayout

 
vineet kumar chaudhry
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The leftmost column has address gridx=0 and the top row has address gridy=0



Then why does this code insert the text in the CENTER. I want the code to be inserted at upper left corner that why I gave gridx and gridy zero
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide appropriate values for weightx / weighty / fill. Play around with that and post back if you aren't successful.

And for your future reference, please UseCodeTags. I've added them for you this time.

edit: And gridwidth has nothing to do since you only ever use one column.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!