/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. import javax.swing.*; 

2. import java.awt.*; 

3. import java.awt.event.*; 

4.  

5. public class Split 

6.     extends JApplet 

7.

8.   JSplitPane  splitp ; 

9.   JPanel pleft, pright ; 

10.  

11.   public void init() 

12.   { 

13.     pleft = new JPanel(); 

14.     pright = new JPanel(); 

15.     pleft.setBackground ( Color.yellow ); 

16.     pright.setBackground ( Color.pink ); 

17.     pleft.add ( new JButton("Buttons up !") ); 

18.     pright.add ( new JTextField ("I'm always right") ); 

19.  

20.     splitp = new JSplitPane 

21.     ( JSplitPane.HORIZONTAL_SPLIT

22.        false, pleft,  pright ) ; 

23.  

24.     setContentPane ( splitp ); 

25.   } 

26.

27.