*
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 Android Security Essentials Live Lessons this week in the Android 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: 19655
    
  18

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
 
Similar Threads
Just finished my first GUI program (a planner application) ... could you give me feedback?
JDialog Box closes main application
Newbie question on JGoodies-FormLayout/DefaultFormBuilder...
JGoodies DefaultFormBuilder and separator question
form design