title: Integrate JTabbedPane into already made GUI
body: <p>I created a GUI with a JFrame and a contentPanel. This contentPanel was one aspect of my gui. I have now decided I want to further develop this GUI, and want to have a JTabbedPanel in it.
  I want the contentPanel that is currently displaying to be one of the tabs in the JTabbedPane.</p>
  <p>Essentially, I want my JFrame, with a JPanel that has JTabbedPane, and within these tabs I want to put JPanel(s). I'm also using GridBagLayout on the JPanel that currently displays the GUI, and it's making everything hard.</p>
  <p>Someone please help.
  Here are some screenshots. <a href="https://i.stack.imgur.com/FgHVl.png" rel="nofollow noreferrer">Current GUI Screenshot</a> <a href="https://i.stack.imgur.com/9s02B.png" rel="nofollow noreferrer">Here's what I want it to be like</a></p>
  <p>Here's my GUI Code:
  ``java</p>
  <p>public GUI() {</p>
  <pre><code>    loadRegPlateArray();
  
      
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setBounds(500, 200, 1000, 600);
      contentPane = new JPanel();
      contentPane.setBackground(Color.BLACK);
      contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
      setContentPane(contentPane);
      GridBagLayout gbl_contentPane = new GridBagLayout();
      gbl_contentPane.columnWidths = new int[]{0, 131, 160, 114, 16, 117, 147, 246, 0};
      gbl_contentPane.rowHeights = new int[]{0, 75, 56, 50, 61, 55, 69, 56, 40, 40, 10, 0};
      gbl_contentPane.columnWeights = new double[]{1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
      gbl_contentPane.rowWeights = new double[]{1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
      contentPane.setLayout(gbl_contentPane);
      
      JComboBox comboBox = new JComboBox();
      
      comboBox.setModel(new DefaultComboBoxModel(cl.regArray));
      GridBagConstraints gbc_comboBox = new GridBagConstraints();
      gbc_comboBox.insets = new Insets(0, 0, 5, 5);
      gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
      gbc_comboBox.gridx = 2;
      gbc_comboBox.gridy = 1;
      contentPane.add(comboBox, gbc_comboBox);
      
      
      
      JButton btnNewButton = new JButton(&quot;Add new car&quot;);
      GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
      gbc_btnNewButton.insets = new Insets(0, 0, 5, 5);
      gbc_btnNewButton.gridx = 3;
      gbc_btnNewButton.gridy = 1;
      contentPane.add(btnNewButton, gbc_btnNewButton);
      
      rest of the content of the gui (jlabels etc)
  </code></pre>
  <pre><code>
  Thank you!
  </code></pre>