title: How to align Button in a JPanel this way
body: <p>I'm trying to create a graphic interface using <code>JPanel</code> and <code>JButton</code>.  So far it's good except when I'm creating the <code>JButton</code> instances, they seem to align within the same line.  I want every button to be in one line, not all in the same line.</p>
  
  <p>How do I achieve the desired effect?</p>
  
  <pre><code>public class Interface  extends JFrame{
  
      public  Interface ()
      {
      //frame 
          super("Panel");
          pack();
          setSize(500,400);
          setVisible(true);
  
      //declaration container
      Container c;
      c=getContentPane();
      c.setLayout(new BorderLayout());
      //declaration des panel avec leurs caracteristiques
  
      JPanel menu =new JPanel();
      JPanel MessageList =new JPanel();
      JPanel about=new JPanel();
  
      menu.setLayout(new FlowLayout());
      MessageList.setLayout(new FlowLayout());
      about.setLayout(new FlowLayout());
  
      menu.setBackground(Color.blue);
      MessageList.setBackground(Color.cyan);
      about.setBackground(Color.cyan);
  
      c.add(menu,BorderLayout.WEST);
      c.add(MessageList,BorderLayout.EAST);
      c.add(about,BorderLayout.SOUTH);
      //--------Button---------------------
      JButton button1=new JButton("button1");
      JButton button2=new JButton("Button2");
  
      menu.add(button1);
      menu.add(button2);
      //-----------------------------
          }
  
      public static void main(String args[])
      {
          Interface Message=new Interface();
          Message.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      }
  }
  </code></pre>