Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GrigBagLayout - how to make it left or right justified?

Status
Not open for further replies.

botatun

Programmer
Mar 7, 2006
40
US
I used the GridBagLayout in my panel with the GridBagConstraints.
All elements locates correctly, but all columns align to center, but I want to change it to left or right.
How to do it?
Thank you.
Vadim
 
//try
GridBagConstraints.NORTH
GridBagConstraints.SOUTH
GridBagConstraints.WEST
GridBagConstraints.EAST
 
I tried that:
[green]
GridBagLayout gblConnnect = new GridBagLayout();
setLayout(gblConnnect);
GridBagConstraints cbcConnect = new GridBagConstraints();
cbcConnect.fill = GridBagConstraints.WEST;
...
gblConnnect.setConstraints(jlUser, cbcConnect);
add(jlUser, cbcConnect);
...
gblConnnect.setConstraints(jlPwd, cbcConnect);
add(jlPwd, cbcConnect);
[/green]

The jlUser label is still the above the jlPwd and both centered.
What I do wrong?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top