Computer Science Canada

New Panel not showing up

Author:  zuber [ Thu Jun 12, 2008 1:17 pm ]
Post subject:  New Panel not showing up

This is probably me missing something simple, but I can't seem to get my choice boxes to appear on screen (note that if you click where they should be, they do appear, one at a time)
code:
public void writeQuizFromFile (String name) throws IOException
    {
        BufferedReader input = new BufferedReader (new FileReader (name));
        String[] question = new String [5];
        JRadioButton[] [] choice = new JRadioButton [4] [5];
        ButtonGroup group[] = new ButtonGroup [5];
        JPanel quizPanel = new JPanel (new GridLayout (10, 10));
        String temp;
        for (int j = 0 ; j < 5 ; j++)
        {
            question [j] = input.readLine ();
            group [j] = new ButtonGroup ();
            for (int k = 0 ; k < 4 ; k++)
            {
                temp = input.readLine ();
                choice [k] [j] = new JRadioButton (temp);
                choice [k] [j].setActionCommand (temp);

                group [j].add (choice [k] [j]);
                choice [k] [j].addActionListener (this);
                quizPanel.add (choice [k] [j]);
            }

        }
        quizPanel.add (button [9]);
        button [9].setVisible (true);
        panel.setVisible (false);
        getContentPane ().add (quizPanel);
        quizPanel.show ();
     
    }

Any thoughts as to how I make them appear?

Author:  zuber [ Thu Jun 12, 2008 3:02 pm ]
Post subject:  Re: New Panel not showing up

Never mind, just realized I was using JPanel instead of Panel, problem solved


: