Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swt buttons wont right-align" Watch "swt buttons wont right-align" New topic

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!!!
I agree. Here's the link:
subject: swt buttons wont right-align
Similar Threads
Dialog resize in SWT
Using Eclipse SWT Image, JDBC SQLite and JAVA to insert, store and retrieve Images.
Using JDBC SQLite, Eclipse SWT Image and JAVA to insert, store and retrieve Images.
swt styledtext search/find next
SWT layout