I'm trying to create an array of two radio buttons.
but with the code i have right now it just wont show up on my jframe.
Can anyone tell me what I might be doing wrong? Help please..
Here is a snippet of my code .....I'm only working on the gui part right now, so htas why i have not used the listeners yet. but i just need to get the radio buttons to show up on the frame.
int howMany;
String[] optStrings = {"Exempt","Tax Rate", " "};
ButtonGroup grpOperator = new ButtonGroup();
JRadioButton[] optSelections = new JRadioButton[3];
JPanel pnlDesc = new JPanel();
public HudsonHillsProjectJKSample()
{
for (int i = 0; i < howMany; i++)
{
optSelections[i] = new JRadioButton(optStrings[i]);
optSelections[i].addItemListener(this);
grpOperator.add(optSelections[i]);
pnlDesc.add(optSelections[i]);
}
add (pnlDesc, BorderLayout. WEST );
public static void main (String[] arg)
{
HudsonHillsProjectJKSample f = new HudsonHillsProjectJKSample ();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setTitle("Hudson Hills");
f.setSize(560,410);
f.setLocation(375,200);
f.setVisible(true);
}//End MAIN
}