Forums Register Login

Best Layout for Simple Forms?

+Pie Number of slices to send: Send
I am sick of having to do all of these workarounds for create simple forms using the Swing API. What is the easiest and most effective way to create a simple form ? And whats Layouts should I use. Below is an example of what the form would look like.

Name{Label}: {TextField}
Address:{Label} {TextField}

etc.. etc..
all aligned. What is the best solution for this type of typical form. Currently I'm trying to utilize the BoxLayout nested but its very difficult to align the labels and the text fields or likewise the text fields etc.. Any help would be greatly appreciated.
+Pie Number of slices to send: Send
GridLayout would work really well for a simple form like that. GridbagLayout is of course the most robust but can be the most complicated. JGoodies Forms would world really well for you to.
+Pie Number of slices to send: Send
The problem with Gridlayout is that is uses up all the room correct? My form is nested within other panels with room to spare at the bottom intentionally for panels in the East of the Border Layout. I've tried to add JPanels with FlowLayout inside the GridLayout but they still take up all avaiable room looking kind of silly.
+Pie Number of slices to send: Send
I would strongly recommend JGoodies Forms. Makes layouts a breeze, and has a couple of nice features. I really like the seperators (labels on a line, creates a nice visual seperation).
+Pie Number of slices to send: Send
 

Originally posted by Steven Bell:
I would strongly recommend JGoodies Forms. Makes layouts a breeze, and has a couple of nice features. I really like the seperators (labels on a line, creates a nice visual seperation).


Agree 100% and I am really not an experienced swing developer.
+Pie Number of slices to send: Send
I find designing forms in NetBeans is pretty easy and gives great results. I'm doing more complex layouts so it might not be worth it in your case, as you then have to put up with the netbeans 'do not modify' sections and form files.
+Pie Number of slices to send: Send
I appreciate all of the replies so far. This form is actually nested inside a complicated panel which contains several other features but this simple part is giving me trouble. I know that JGoodies forms looks great but I like to know how to do something before I use a GUI tool to do the work that I should know how to do myself. Again thanks for the support and keep em coming.
+Pie Number of slices to send: Send
JGoodies forms isn't a GUI tool. It is a package that contains LayoutManagers and a simple, but powerful, means to define growth and size of rows and columns.
Here is some layout code I have using JGoodies Forms:
+Pie Number of slices to send: Send
I also ran across a LayoutManager caled ParagraphLayout which is the easiest manager I have ever used. You guys might want to also check this out for simple data entry forms. Its a breeze.

JHLabs ParagraphLayout Manager
[ April 07, 2005: Message edited by: Sloan Bowman ]
+Pie Number of slices to send: Send
I'd recommand using FormLayout in conjunction with a builder. The ones included with the FormLayout package are a good starting point to extend if you need something special. You should be able to get down to just a few add methods.
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
JGoodies forms comes with a good documentation. I was a bid scary before using it >1 year ago. With the help of the documentation and sample code it was question of 4 hours or so to replace Netbeans generated GridBagLayout with JGoodies FormLayout.
Its important that open Source projects do have a good documentation and FormLayout definitivedly has one.
Are you okay? You look a little big. Maybe this tiny ad will help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 12840 times.
Similar Threads
Here are the dependencies Madhav .
How to stop JTextField collapsing when using GridBagLayout?
best solution to questionnaire web app
Java GUI Builders?
html file with multiple form elements
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:11:15.