• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[solved]GridLayout problem

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to group JRadioButton in a 'box'



i want the looks in following arrangement
[alias |jtf_alias ]
[keyalg |jrb_DSA + jrb_RSA]
[keysize |jtf_keysize ]
[keystore |jtf_keystore ]
[validity |jtf_validity ]
[ October 12, 2008: Message edited by: L Willie ]
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GridLayout is usually easy to use, only the Components all seem to come out the same size.

For 5 rows, 2 columns,

Add a label then a button, that's the 1st row.
Add a label then a button, that's the 2nd row.
Add a label then a button, that's the 3rd row, etc.

Whenever I have used GridLayout I didn't bother with Constraints or anything. Just the GridLayout.
 
L Willie
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please try to run my program,then you'll understand my problem.
i thought a solution,that is use blank JLabel to fill up 3rd column for each rows and cheat GridLayout,but i think this is not a standard method.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
put the radiobuttons into their own jpanel, then add that jpanel into the main jpanel like so:

 
L Willie
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank a lot to pete stein.
thank to JavaRanch because of help me solve lot of java problem that i face so far.
 
reply
    Bookmark Topic Watch Topic
  • New Topic