• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Adjust alignment of button in gridlayout?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, is it possible to change the horizontal alignment of a button or label in a gridlayout? I have a form with 2 labels, 2 textfields, and 1 button.

Here's the layout:
X = label
Y = TextField
Z = Button

X Y
X Y
Z

How can I get Z to be under Y? Thanks in advance.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
add an empty label prior to adding Z
 
Bob Zoloman
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So for that kind of layout you can't use SwingConstants.Right or some other method for aligning?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you're not aligning anything.

you have 6 compartments/cells, 3 x 2.
they fill up left to right then top to bottom.

so, to get something into cell 5 (0-based),
you first have to put something in the prior 0 to 4

[edit] had 2 x 3
[ August 29, 2006: Message edited by: Michael Dunn ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic