title: Creating Java Swing - JFrame, JRadioButton, JCheckBox
body: <p>I am new to java swing. I have pasted my code below for your reference,</p>
  
  <p>I am trying to create 2 <code>JRadioButtons</code> in <code>JFrame</code> and if i click that <code>JRadioButton</code> it 
       should display 5 <code>JCheckboxes</code> for each <code>JRadioButton</code> in the same <code>JFrame</code>.</p>
  
  <p><code>JRadiobutton</code> is displaying now but if i click that <code>JRadioButton</code> <code>"JCheckboxes"</code> is not 
       displaying. please see my code below, if any changes need in my code, please do 
       accordingly.i am struggling for this.  </p>
  
  <p><code>MultipleFramesExample.java</code> calling <code>createMainView()</code> in <code>Mainview.java</code> class</p>
  
  <pre><code>public class MultipleFramesExample extends JFrame {
  
   public  void fun()
   {
  
    MainView MV = new MainView();
    MV.createMainView();
   }
  
   public static void main(String[] args) {
     MultipleFramesExample ob=new MultipleFramesExample();
     ob.fun();
   }
  }
  </code></pre>
  
  <p><code>Mainview.java</code> creates <code>Jframe</code> and <code>Buttons</code> etc..</p>
  
  <pre><code>    public class MainView extends JFrame implements ActionListener  {
  
       JFrame frame1;
       MainView mV=null;
       JCheckBox chinButton;
       JRadioButton birdButton;
      MultipleFramesExample ob=new MultipleFramesExample();
    JPanel panel = new JPanel(new BorderLayout());
  
    public void createMainView() {
    mV = new MainView();
  
    frame1 = new JFrame();
    frame1.setTitle("Main View");
    frame1.setSize(50,50);
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame1.setVisible(true);
     birdButton = new JRadioButton("click");
    frame1.getContentPane().add(birdButton);
    birdButton.addActionListener(this);
  
   }
  
    public void actionPerformed(ActionEvent event) {
      Container contentPane = frame1.getContentPane();
     contentPane.setLayout(new FlowLayout());
  
      JCheckBox jb=new JCheckBox();
      if (event.getActionCommand().equals(birdButton)) {
  
     frame1.add(new JCheckBox("JIL1"));
     frame1.add(new JCheckBox("JIL2"));
     frame1.add(new JCheckBox("JIL3"));
     frame1.add(new JCheckBox("JIL4"));
     frame1.add(new JCheckBox("JIL5"));
     frame1.setVisible(true);
  
     //panel.add(jb, BorderLayout.PAGE_START);
  
    // panel.getComponentCount();
       }
     }
   public void fun1(){
  
   }
  }
  </code></pre>
  
  <p>Is it possible to create them like this?</p>