ViceroyFizzlebottom
asked on
Formatting a java applet
Hey there. I'm creating a 350X275 sized applet. I want to have 5 labels on the left edge (BorderLayout.WEST) and 4 textboxes and one group of two radio buttons on the right. At the bottom two buttons. Something like this:
label 1 textbox
label 2 textbox2
label 3 textbox3
label 4 radiobtn 1 radiobtn 2
label 5 textbox5
button1 button2
I can't for the life of me get it format though. I have the base JPanel, another JPanel for the labels, a third and fourth for the textboxes and
buttons respectively. My textboxes always end up being 2-3 textbox heights though and look really bloated.
Any formatting suggestions or tips would be appreciated.
label 1 textbox
label 2 textbox2
label 3 textbox3
label 4 radiobtn 1 radiobtn 2
label 5 textbox5
button1 button2
I can't for the life of me get it format though. I have the base JPanel, another JPanel for the labels, a third and fourth for the textboxes and
buttons respectively. My textboxes always end up being 2-3 textbox heights though and look really bloated.
Any formatting suggestions or tips would be appreciated.
Did you try GridBagLayout: http://www.javaalmanac.com/cgi-bin/search/find.pl?words=GridBagLayout
Yes, use GridBagLayout.. I also wrote a tutorial on it the other week, see if it helps:
http://www.freewebs.com/darkins/tutorials/create_gui_in_java.html
>> IM
http://www.freewebs.com/darkins/tutorials/create_gui_in_java.html
>> IM
InteractiveMind, I actually saw it (nice work) sorry for not mentioning it :-(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(You could shorten that code if necessary...) ;)
> My textboxes always end up being 2-3 textbox heights though and look really bloated.
What layout are you using for their container panel? A BoxLayout sounds like what you need.
What layout are you using for their container panel? A BoxLayout sounds like what you need.