281a93e516fecef6dc7905a29d3524fe52cbc456
[jalview.git] / src / jalview / jbgui / GSplitFrame.java
1 package jalview.jbgui;
2
3 import javax.swing.JComponent;
4 import javax.swing.JInternalFrame;
5 import javax.swing.JSplitPane;
6
7 public class GSplitFrame extends JInternalFrame
8 {
9   private static final long serialVersionUID = 1L;
10
11   private JComponent topComponent;
12
13   private JComponent bottomComponent;
14
15   /**
16    * Constructor
17    * 
18    * @param top
19    * @param bottom
20    */
21   public GSplitFrame(JComponent top, JComponent bottom)
22   {
23     this.topComponent = top;
24     this.bottomComponent = bottom;
25     JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top,
26             bottom);
27     splitPane.setVisible(true);
28     add(splitPane);
29     splitPane.setDividerLocation(0.5d);
30     splitPane.setResizeWeight(0.5d);
31     splitPane.setDividerSize(0);
32   }
33
34   public JComponent getTopComponent()
35   {
36     return topComponent;
37   }
38
39   public JComponent getBottomComponent()
40   {
41     return bottomComponent;
42   }
43 }