Example usage for javax.swing JSplitPane JSplitPane

List of usage examples for javax.swing JSplitPane JSplitPane

Introduction

In this page you can find the example usage for javax.swing JSplitPane JSplitPane.

Prototype

public JSplitPane(int newOrientation, boolean newContinuousLayout) 

Source Link

Document

Creates a new JSplitPane with the specified orientation and redrawing style.

Usage

From source file:com.intuit.tank.tools.debugger.RequestResponsePanel.java

public void init() {
    JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
    pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    requestTA = new RTextArea();
    requestTA.setEditable(false);/*from  w  w w.  j  a va2 s . c o  m*/
    requestTA.setAutoscrolls(true);
    requestTA.setHighlightCurrentLine(false);
    JScrollPane sp1 = new JScrollPane(requestTA, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sp1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    JPanel reqPane = new JPanel(new BorderLayout());
    // JPanel titlePanel = new JPanel(new BorderLayout());
    // titlePanel.add(BorderLayout.WEST, new JLabel("Request:"));
    // JButton saveBT = new JButton(parent.getDebuggerActions().getSaveReqResponseAction());
    // saveBT.setText("");
    // titlePanel.add(BorderLayout.EAST, saveBT);
    reqPane.add(BorderLayout.NORTH, new JLabel("Request:"));
    reqPane.add(BorderLayout.CENTER, sp1);
    pane.setTopComponent(reqPane);

    responseTA = new RTextArea();
    responseTA.setEditable(false);
    responseTA.setAutoscrolls(true);
    responseTA.setHighlightCurrentLine(false);
    JScrollPane sp2 = new JScrollPane(responseTA, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sp2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    JPanel responsePane = new JPanel(new BorderLayout());
    responsePane.add(BorderLayout.NORTH, new JLabel("Response:"));
    responsePane.add(BorderLayout.CENTER, sp2);
    pane.setBottomComponent(responsePane);
    pane.setDividerLocation(0.5D);
    pane.setResizeWeight(0.5D);

    add(pane, BorderLayout.CENTER);
    JPopupMenu popupMenu = new JPopupMenu();
    popupMenu.add(parent.getDebuggerActions().getSaveReqResponseAction());
    requestTA.setPopupMenu(popupMenu);
    responseTA.setPopupMenu(popupMenu);
}