wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes swt buttons wont right-align Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swt buttons wont right-align" Watch "swt buttons wont right-align" New topic
Author

swt buttons wont right-align

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

Good Day..

I need to create a dialog box for user to enter their name and implemented gridlayout.

I divide the shell widget into 3 columns and I want the first column be occupied by the label having it left aligned. Then I merge the last two columns and wanted the two buttons place right aligned into the shell.

But my problem is, the GUI does not draws itself correctly. Here's my code.



I want the two button cmdOK and cmdCancel be right align and in level with the label.

I can't seem to have the GUI drawn as what I wanted it to look so I added a label,lblHidden in this case, set its visible property to false and occupied the last two columns. That did the trick and the button right aligned themselves correctly.

I really wanted to know why this is so and appreciate any suggestions or maybe I just miss something in my code. I hope I had explain thing clearly.. Thanks.


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: swt buttons wont right-align