title: Why does setBounds() method not work even after setting setLayout() as null?
body: <p>Usually setBounds() method positions the called object in the specified location and in specified size..right?
  I created a JFrame class and demonstrated its working on a button with setting setLayout(null).
  Then I created a class which extends JPanel and put some components in it.
  The Bounds for these components are set inside a method.
  An object of this class is included in a class which extends JFrame.
  Then this object calls setBound() method.
  But the result does not show the components in JPanel extended class.
  the cde fragment is given below.</p>
  
  <pre><code>class Administrator extends JFrame implements ActionListener
  {
    public Administrator()
    {
      setTitle("Administration"); 
      setSize(500,500);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      setLayout(null);    
      JButton newbutton=new JButton(" New.. ");
      newbutton.addActionListener(this);
      add(newbutton);
      newbutton.setBounds(100,100,100,25);
      setVisible(true);
  
      public static void main(String arg[])
      {
        new Administrator();
      } 
  
      public void actionPerformed(ActionEvent ae)
    {
      String act=(String)ae.getActionCommand();
      if(act.equals("New Registry..")||act.equals(" New.. "))
       {
          regPanel rgpnl=new regPanel();
  
          Dimension sz;
          sz=rgpnl.getPreferredSize(); 
          rgpnl.setBounds(800,800,sz.width,sz.height);       
          rgpnl.arrangeComponents();   
          add(rgpnl);
  
  
          repaint();
          setVisible(true);
       }
  }
  class regPanel extends JPanel 
  {
    Label namelab;
    JTextField name;
    JButton do_register;
    public regPanel()
    {
      //Container   = get ();
      setLayout(null);
  
      namelab=new Label("Name :");
      name=new JTextField(20); 
      add(namelab); 
      add(name);
      add(do_register); 
     }
     public void arrangeComponents() 
    {
      Dimension size;
  
      size=namelab.getPreferredSize();
      namelab.setBounds(20,10,size.width,size.height);
      name.getPreferredSize();
      name.setBounds(150,10,size.width,size.height); 
      do_register.setBounds(10,10,size.width,size.height);
  
      repaint();
  
    }    
  }     
  </code></pre>