title: Creating JSplitPane with 3 panels
body: <p>I would like to create a window, with 3 jPanels, separated by splitPane-s. The left, and the right one should be resizable by the user, and the one in the middle should fill the remaining space.</p>
  
  <p>I've created it, but if I move the first splitPane, then the second one is also moving. And I'm not sure, if I use the best method for what I want.</p>
  
  <pre><code>import java.awt.BorderLayout;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.JSplitPane;
  
  public class MyWindow extends JFrame {
  
      public MyWindow() {
          this.setLayout(new BorderLayout());
  
          JPanel leftPanel = new JPanel();
          JPanel centerPanel = new JPanel();
          JPanel centerPanel2 = new JPanel();
          JPanel rightPanel = new JPanel();
  
          JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, centerPanel);
          JSplitPane sp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centerPanel2, rightPanel);
  
          centerPanel.setLayout(new BorderLayout());
          this.add(sp, BorderLayout.CENTER);
          centerPanel.add(sp2, BorderLayout.CENTER);
  
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          this.setSize(500, 500);
          this.setVisible(true);
      }
  
  }
  </code></pre>