• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[solved]GridLayout problem

 
L Willie
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • 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 ]
 
Campbell Ritchie
Sheriff
Pie
Posts: 50278
80
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic