This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JGoodies FormLayout question place buttons at center  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JGoodies FormLayout question place buttons at center  " Watch "JGoodies FormLayout question place buttons at center  " New topic
Author

JGoodies FormLayout question place buttons at center

Sethuraman Ramasubramanian
Greenhorn

Joined: Apr 26, 2009
Posts: 7
I am trying to learn JGoodies FormLayout. I started working with the Default FormBuilder and I am having trouble aligning 2 buttons at the centre of the panel. I need to do this:

User Name Text Field
Password Text Field
..
..
..
Create Cancel

The create and cancel buttons should appear bang on the centre of the panel. The buttons always appear on the left not on the center. The code that I am using:
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19781
    
  20

The button panel is only bound to the first column, with "fill:pref". You should include the colspan, 3:
This way the button bar will cover your entire row.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Sethuraman Ramasubramanian
Greenhorn

Joined: Apr 26, 2009
Posts: 7
Rob Prime wrote:The button panel is only bound to the first column, with "fill:pref". You should include the colspan, 3:
This way the button bar will cover your entire row.


Oh thats great!!! Man I was so dumb! Was struggling with that for half a day! Thanks a lot. You just made my day.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JGoodies FormLayout question place buttons at center