@@ -0,0 +1,1840 @@
+package swing;%0D%0A%0D%0Aimport java.awt.Color;%0D%0Aimport java.awt.event.WindowAdapter;%0D%0Aimport java.awt.event.WindowEvent;%0D%0A%0D%0Aimport javax.swing.JFrame;%0D%0Aimport javax.swing.JOptionPane;%0D%0Aimport javax.swing.JPanel;%0D%0Aimport javax.swing.JSplitPane;%0D%0A%0D%0Apublic class TestJSplitPane2 %7B%0D%0A  private void init() %7B%0D%0A    JFrame frame = new JFrame();%0D%0A    JPanel one = new JPanel();%0D%0A    one.setBackground(Color.YELLOW);%0D%0A    JPanel two = new JPanel();%0D%0A    two.setBackground(Color.GREEN);%0D%0A    JPanel three = new JPanel();%0D%0A    three.setBackground(Color.RED);%0D%0A    JPanel four = new JPanel();%0D%0A    four.setBackground(Color.BLUE);%0D%0A    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, one, two);%0D%0A    splitPane.setResizeWeight(0.5);%0D%0A    splitPane.setOneTouchExpandable(true);%0D%0A    JSplitPane splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, three, four);%0D%0A    splitPane2.setResizeWeight(0.5);%0D%0A    splitPane2.setOneTouchExpandable(true);%0D%0A    JSplitPane splitPane3 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, splitPane, splitPane2);%0D%0A    splitPane3.setResizeWeight(0.5);%0D%0A    splitPane3.setOneTouchExpandable(true);%0D%0A    frame.setContentPane(splitPane3);%0D%0A    frame.pack();%0D%0A    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);%0D%0A    frame.addWindowListener(new WindowAdapter() %7B%0D%0A      @Override%0D%0A      public void windowClosing(WindowEvent e) %7B%0D%0A        int reply =%0D%0A            JOptionPane.showConfirmDialog(null, %22Do you really want to exit?%22,%0D%0A                %22Exit form the application%22, JOptionPane.YES_NO_OPTION);%0D%0A        if (reply == JOptionPane.YES_OPTION) %7B%0D%0A          JOptionPane.showMessageDialog(null, %22Bye! See you later :)%22);%0D%0A          System.exit(0);%0D%0A        %7D%0D%0A      %7D%0D%0A    %7D);%0D%0A    frame.setVisible(true);%0D%0A  %7D%0D%0A%0D%0A  public static void main(String%5B%5D args) %7B%0D%0A    new TestJSplitPane2().init();%0D%0A  %7D%0D%0A%7D%0D%0A

Add an advanced example about the JSplitPane. Using three JSplitPane with colors. Show a confirm dialog and message dialog if the user wants to exit.