title: How to add multiple JPanels to JFrame with different sizes
body: <p>I tried to do this from stackoverflow: </p>
  
  <p><a href="https://stackoverflow.com/questions/6325384/adding-multiple-jpanels-to-jframe">adding multiple jPanels to jFrame</a> </p>
  
  <p>But that didn't seem to work out like in the example, could anyone tell me what im doing wrong?
  Im trying to add multiple JPanels with each their own sizes to the JFrame. I was also hoping it was possible to give each JPanel specific sizes and ability to put them on the exact spot i want. </p>
  
  <p>Picture of what i try to make:
  <img src="https://i.stack.imgur.com/ErT0X.png" alt="Mockup"></p>
  
  <p>This is my code so far:
       public ReserveringenGUI(ReserveringController controller) {
          this.controller = new ReserveringController();
          makeFrame();
      }</p>
  
  <pre><code>public void makeFrame() {
      JFrame frame1 = new JFrame();
      frame1.setTitle("Reserveringen");
      frame1.setSize(800, 500);
      frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      JPanel container = new JPanel();
      container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
  
      JPanel willekeurigPanel = new JPanel();
      willekeurigPanel.setSize(400, 500);
      willekeurigPanel.setBackground(Color.YELLOW);
      willekeurigPanel.setVisible(true);
  
      JPanel overzichtPanel = new JPanel();
      overzichtPanel.setSize(400, 500);
      overzichtPanel.setBackground(Color.red);
      overzichtPanel.setVisible(true);
  
      DateFormat format = new SimpleDateFormat("dd-MM-yyyy");
      DateFormatter df = new DateFormatter(format);
      JFormattedTextField dateBeginField = new JFormattedTextField(df);
      dateBeginField.setPreferredSize(new Dimension(250, 20));
      dateBeginField.setValue(new Date());
  
      JFormattedTextField dateEndField = new JFormattedTextField(df);
      dateEndField.setPreferredSize(new Dimension(250, 20));
      dateEndField.setValue(new Date());
  
      JTextField klantnummer = new JTextField();
      klantnummer.setPreferredSize(new Dimension(250, 20));
      JTextField artikelnummer = new JTextField();
      artikelnummer.setPreferredSize(new Dimension(250, 20));
  
      JLabel dateBeginLabel = new JLabel("Begin Datum ");
      JLabel dateEndLabel = new JLabel("Eind datum: ");
      JLabel klantID = new JLabel("Klant nummer: ");
      JLabel artikelID = new JLabel("Artikel nummer: ");
  
      JButton voegReserveringToe = new JButton("Voeg toe");
  
      voegReserveringToe.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
              voegReserveringToeActionPerformed(evt);
          }
      });
  
      willekeurigPanel.add(dateBeginLabel);
      willekeurigPanel.add(dateBeginField);
  
      willekeurigPanel.add(dateEndLabel);
      willekeurigPanel.add(dateEndField);
  
      willekeurigPanel.add(klantID);
      willekeurigPanel.add(klantnummer);
  
      willekeurigPanel.add(artikelID);
      willekeurigPanel.add(artikelnummer);
  
      willekeurigPanel.add(voegReserveringToe);
  
  
  
      container.add(willekeurigPanel);
      container.add(overzichtPanel);
  
      frame1.add(container);
      frame1.setVisible(true);
  }
  </code></pre>