Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gui components alignment

 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using a GUI building application, here I can drag and drop the components to create a form. I need help in alignment of these components.

Each component has the following positioning attributes: Left,Top,width,Height. (in terms of %position in parent)

Suppose I have 5 labels and corresponding text fields. How can I calculate the values of Left,Top,width,Height for each component relative to the parent (canvas)?

example:

how to align the following Form:

--------------------------------------------------------------------
|
|First Name: -TextField----- |
|
|Second Name:--TextField----- |
|
|Address:--TextField------- |
|
|E-mail: --TextField------ |
|
|Telephone Number:--TextField----- |
|
| SubmitBtn |
|
---------------------------------------------------------------------------


Thanks and Best Regards

Ayub
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> how to align the following Form:

panel_1(BorderLayout)
panel_2(gridLayout(1,2))//add panel_3 and panel_4 to this panel
panel_3(gridlayout(5,1))//add all labels to this panel
panel_4(gridlayout(5,1))//add all textfields to this panel
panel_5(leave as flowLayout)//add submit button to this panel
add panel_2 to panel_1(BorderLayout.CENTER)
add panel_5 to panel_1(BorderLayout.SOUTH)
 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

Thank you for the info. Currently I am using a different custom application. I am not using SWING.

Thanks and Best Regards

Ayub.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic