Link to home
Start Free TrialLog in
Avatar of ViceroyFizzlebottom
ViceroyFizzlebottomFlag for United States of America

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.
Avatar of aozarov
aozarov

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
InteractiveMind, I actually saw it (nice work) sorry for not mentioning it :-(
ASKER CERTIFIED SOLUTION
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(You could shorten that code if necessary...) ;)
Avatar of Mick Barry
> 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.