Example usage for javax.swing JSplitPane VERTICAL_SPLIT

List of usage examples for javax.swing JSplitPane VERTICAL_SPLIT

Introduction

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

Prototype

int VERTICAL_SPLIT

To view the source code for javax.swing JSplitPane VERTICAL_SPLIT.

Click Source Link

Document

Vertical split indicates the Components are split along the y axis.

Usage

From source file:logdruid.ui.mainpanel.MetadataRecordingSelectorPanel.java

/**
 * Create the panel./*from w  w  w .  j  ava 2s .  com*/
 */
public MetadataRecordingSelectorPanel(Repository rep, Source src) {
    repository = rep;
    source = src;
    records = rep.getRecordings(MetadataRecording.class);
    // Collections.sort(records);
    Iterator it = records.iterator();
    while (it.hasNext()) {
        Recording record = (Recording) it.next();
        data.add(new Object[] { record.getName(), record.getRegexp(), record.getType(),
                src.isActiveRecordingOnSource(record) });
    }

    model = new logdruid.ui.mainpanel.MetadataRecordingSelectorPanel.MyTableModel(data, header);

    logger.info("source is " + ((source == null) ? "null" : src.getSourceName()));
    setLayout(new BorderLayout(0, 0));

    JPanel panel_1 = new JPanel();
    panel_1.setLayout(new BorderLayout(0, 0));

    table = new JTable(model);
    JScrollPane scrollPane = new JScrollPane(table);
    panel_1.add(scrollPane, BorderLayout.CENTER);

    table.setPreferredScrollableViewportSize(new Dimension(0, 150));
    table.setFillsViewportHeight(true);
    table.setAutoCreateRowSorter(true);

    // Set up column sizes.
    initColumnSizes(table);
    reloadTable();

    JSplitPane splitPane = new JSplitPane();
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    add(splitPane);

    jPanelDetail = new JPanel();
    splitPane.setBottomComponent(jPanelDetail);
    splitPane.setTopComponent(panel_1);

    jPanelDetail.setLayout(new BorderLayout(0, 0));
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
            // ((table.getSelectedRow()!=-1)?table.convertRowIndexToModel(table.getSelectedRow()):-1)
            // persist repository
            // display selected row
            int selectedRow = ((table.getSelectedRow() != -1)
                    ? table.convertRowIndexToModel(table.getSelectedRow())
                    : -1);

            logger.info("ListSelectionListener - selectedRow: " + selectedRow);
            if (selectedRow >= 0) {

                if (jPanelDetail != null) {
                    logger.debug("ListSelectionListener - valueChanged");
                    jPanelDetail.removeAll();
                    recEditor = getEditor(repository.getRecording(MetadataRecording.class, selectedRow));
                    if (recEditor != null) {
                        jPanelDetail.add(recEditor, BorderLayout.CENTER);
                    }
                    reloadTable();
                    jPanelDetail.revalidate();
                }
            }
        }
    });
    if (repository.getRecordings(MetadataRecording.class).size() > 0) {
        recEditor = getEditor(repository.getRecording(MetadataRecording.class, 0));
        jPanelDetail.add(recEditor, BorderLayout.CENTER);
        table.setRowSelectionInterval(0, 0);
    }
    if (model.getRowCount() > 0) {
        table.getRowSorter().toggleSortOrder(0);
        table.setRowSelectionInterval(0, 0);
    }
    //reloadTable();
    // jPanelDetail.revalidate();

}

From source file:com.digitexx.ancestry.gui.FrmUpperLowerData.java

private void initGUI() {
    try {/*from w ww  .  j a  v a 2  s  .  co  m*/
        this.setTitle("Uppercase & Lowercase data");
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        AnchorLayout thisLayout = new AnchorLayout();
        getContentPane().setLayout(thisLayout);
        {
            panelMain = new JPanel();
            BorderLayout panelMainLayout = new BorderLayout();
            panelMain.setLayout(panelMainLayout);
            getContentPane().add(panelMain, new AnchorConstraint(0, 1000, 944, 0, AnchorConstraint.ANCHOR_REL,
                    AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
            panelMain.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
            panelMain.setPreferredSize(new java.awt.Dimension(775, 488));
            {
                splitPaneMain = new JSplitPane();
                panelMain.add(splitPaneMain, BorderLayout.CENTER);
                splitPaneMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
                splitPaneMain.setDividerLocation(200);
                {
                    panelColumnLog = new JPanel();
                    BorderLayout panelLogLayout = new BorderLayout();
                    panelColumnLog.setLayout(panelLogLayout);
                    splitPaneMain.add(panelColumnLog, JSplitPane.RIGHT);
                    panelColumnLog.setPreferredSize(new java.awt.Dimension(417, 482));
                    {
                        splitPaneColumnAndLog = new JSplitPane();
                        panelColumnLog.add(splitPaneColumnAndLog, BorderLayout.CENTER);
                        splitPaneColumnAndLog.setDividerLocation(200);
                        {
                            panelLog = new JPanel();
                            BorderLayout panelLogLayout1 = new BorderLayout();
                            panelLog.setLayout(panelLogLayout1);
                            splitPaneColumnAndLog.add(panelLog, JSplitPane.RIGHT);
                            {
                                scrollPaneLog = new JScrollPane();
                                panelLog.add(scrollPaneLog, BorderLayout.CENTER);
                                {
                                    textPaneLog = new JTextPane();
                                    scrollPaneLog.setViewportView(textPaneLog);
                                }
                            }
                        }
                        {
                            panelColumn = new JPanel();
                            BorderLayout panelColumnLayout = new BorderLayout();
                            panelColumn.setLayout(panelColumnLayout);
                            splitPaneColumnAndLog.add(panelColumn, JSplitPane.LEFT);
                            {
                                scrollPaneColumn = new JScrollPane();
                                panelColumn.add(scrollPaneColumn, BorderLayout.CENTER);
                                {
                                    tableField = new JTable() {
                                        @Override
                                        public boolean isCellEditable(int row, int column) {
                                            if (getColumnName(column).equals("Check")) {
                                                return true;
                                            } else {
                                                return false;
                                            }
                                        }

                                        @Override
                                        public Class<?> getColumnClass(int column) {
                                            if (getColumnName(column).equals("Check")) {
                                                return Boolean.class;
                                            } else {
                                                return super.getColumnClass(column);
                                            }
                                        }
                                    };
                                    scrollPaneColumn.setViewportView(tableField);
                                }
                            }
                        }
                    }
                }
                {
                    panelPath = new JPanel();
                    BorderLayout panelPathLayout = new BorderLayout();
                    panelPath.setLayout(panelPathLayout);
                    splitPaneMain.add(panelPath, JSplitPane.LEFT);
                    panelPath.setPreferredSize(new java.awt.Dimension(769, 316));
                    {
                        scrollPanePath = new JScrollPane();
                        panelPath.add(scrollPanePath, BorderLayout.CENTER);
                        {
                            jListPath = new JList();
                            scrollPanePath.setViewportView(jListPath);
                            jListPath.setFont(new java.awt.Font("Arial", 0, 14));
                        }
                    }
                }
            }
        }
        {
            panelFooter = new JPanel();
            AnchorLayout panelFooterLayout = new AnchorLayout();
            getContentPane().add(panelFooter,
                    new AnchorConstraint(944, 1000, 1000, 0, AnchorConstraint.ANCHOR_REL,
                            AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL,
                            AnchorConstraint.ANCHOR_REL));
            panelFooter.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
            panelFooter.setLayout(panelFooterLayout);
            panelFooter.setPreferredSize(new java.awt.Dimension(775, 29));
            {
                buttonRun = new JButton();
                panelFooter.add(buttonRun, new AnchorConstraint(86, 998, 948, 890, AnchorConstraint.ANCHOR_REL,
                        AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
                buttonRun.setText("Run");
                buttonRun.setFont(new java.awt.Font("Arial", 1, 16));
                buttonRun.setPreferredSize(new java.awt.Dimension(83, 25));
                buttonRun.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        buttonRunActionPerformed(evt);
                    }
                });
            }
            {
                checkboxRework = new JCheckBox();
                panelFooter.add(checkboxRework,
                        new AnchorConstraint(86, 155, 948, 3, AnchorConstraint.ANCHOR_REL,
                                AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL,
                                AnchorConstraint.ANCHOR_REL));
                checkboxRework.setText("Rework");
                checkboxRework.setFont(new java.awt.Font("Arial", 1, 16));
                checkboxRework.setForeground(new java.awt.Color(255, 0, 0));
                checkboxRework.setPreferredSize(new java.awt.Dimension(118, 25));
                checkboxRework.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        checkboxReworkActionPerformed(evt);
                    }
                });
            }
        }
        pack();
        this.setSize(783, 551);
        AppUtility.centerFrame(this);
        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                exit();
            }
        });
        ;
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:components.SharedModelDemo.java

public SharedModelDemo() {
    super(new BorderLayout());

    Vector data = new Vector(7);
    String[] columnNames = { "French", "Spanish", "Italian" };
    String[] oneData = { "un", "uno", "uno" };
    String[] twoData = { "deux", "dos", "due" };
    String[] threeData = { "trois", "tres", "tre" };
    String[] fourData = { "quatre", "cuatro", "quattro" };
    String[] fiveData = { "cinq", "cinco", "cinque" };
    String[] sixData = { "six", "seis", "sei" };
    String[] sevenData = { "sept", "siete", "sette" };

    //Build the model.
    SharedDataModel dataModel = new SharedDataModel(columnNames);
    dataModel.addElement(oneData);//from w  w w.j  a v  a  2s .  c o m
    dataModel.addElement(twoData);
    dataModel.addElement(threeData);
    dataModel.addElement(fourData);
    dataModel.addElement(fiveData);
    dataModel.addElement(sixData);
    dataModel.addElement(sevenData);

    list = new JList(dataModel);
    list.setCellRenderer(new DefaultListCellRenderer() {
        public Component getListCellRendererComponent(JList l, Object value, int i, boolean s, boolean f) {
            String[] array = (String[]) value;
            return super.getListCellRendererComponent(l, array[0], i, s, f);
        }
    });

    listSelectionModel = list.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    JScrollPane listPane = new JScrollPane(list);

    table = new JTable(dataModel);
    table.setSelectionModel(listSelectionModel);
    JScrollPane tablePane = new JScrollPane(table);

    //Build control area (use default FlowLayout).
    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    //Build output area.
    output = new JTextArea(10, 40);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    //Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.X_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    listContainer.setBorder(BorderFactory.createTitledBorder("List"));
    listContainer.add(listPane);
    JPanel tableContainer = new JPanel(new GridLayout(1, 1));
    tableContainer.setBorder(BorderFactory.createTitledBorder("Table"));
    tableContainer.add(tablePane);
    tablePane.setPreferredSize(new Dimension(300, 100));
    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(400, 50));
    topHalf.setPreferredSize(new Dimension(400, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.NORTH);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    //XXX: next line needed if bottomHalf is a scroll pane:
    //bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 135));
    splitPane.add(bottomHalf);
}

From source file:TextComponentDemo.java

public TextComponentDemo() {
    super("TextComponentDemo");

    //Create the text pane and configure it.
    textPane = new JTextPane();
    textPane.setCaretPosition(0);/*from ww  w .  j  a v a 2 s.com*/
    textPane.setMargin(new Insets(5, 5, 5, 5));
    StyledDocument styledDoc = textPane.getStyledDocument();
    if (styledDoc instanceof AbstractDocument) {
        doc = (AbstractDocument) styledDoc;
        doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS));
    } else {
        System.err.println("Text pane's document isn't an AbstractDocument!");
        System.exit(-1);
    }
    JScrollPane scrollPane = new JScrollPane(textPane);
    scrollPane.setPreferredSize(new Dimension(200, 200));

    //Create the text area for the status log and configure it.
    changeLog = new JTextArea(5, 30);
    changeLog.setEditable(false);
    JScrollPane scrollPaneForLog = new JScrollPane(changeLog);

    //Create a split pane for the change log and the text area.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog);
    splitPane.setOneTouchExpandable(true);

    //Create the status area.
    JPanel statusPane = new JPanel(new GridLayout(1, 1));
    CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status");
    statusPane.add(caretListenerLabel);

    //Add the components.
    getContentPane().add(splitPane, BorderLayout.CENTER);
    getContentPane().add(statusPane, BorderLayout.PAGE_END);

    //Set up the menu bar.
    createActionTable(textPane);
    JMenu editMenu = createEditMenu();
    JMenu styleMenu = createStyleMenu();
    JMenuBar mb = new JMenuBar();
    mb.add(editMenu);
    mb.add(styleMenu);
    setJMenuBar(mb);

    //Add some key bindings.
    addBindings();

    //Put the initial text into the text pane.
    initDocument();

    //Start watching for undoable edits and caret changes.
    doc.addUndoableEditListener(new MyUndoableEditListener());
    textPane.addCaretListener(caretListenerLabel);
    doc.addDocumentListener(new MyDocumentListener());
}

From source file:logdruid.ui.mainpanel.EventRecordingSelectorPanel.java

/**
 * Create the panel./*from  w  w  w. j ava  2 s . co m*/
 */
public EventRecordingSelectorPanel(final Repository rep, Source src) {
    repository = rep;
    source = src;
    records = rep.getRecordings(EventRecording.class);
    // Collections.sort(records);
    Iterator it = records.iterator();
    while (it.hasNext()) {
        Recording record = (Recording) it.next();
        data.add(new Object[] { record.getName(), record.getRegexp(), record.getType(),
                src.isActiveRecordingOnSource(record) });
    }

    model = new logdruid.ui.mainpanel.EventRecordingSelectorPanel.MyTableModel(data, header);
    logger.info("source is " + ((source == null) ? "null" : src.getSourceName()));
    JPanel panel_1 = new JPanel();
    GridBagConstraints gbc_panel_1 = new GridBagConstraints();
    gbc_panel_1.fill = GridBagConstraints.BOTH;
    gbc_panel_1.insets = new Insets(5, 0, 5, 5);
    gbc_panel_1.gridx = 1;
    gbc_panel_1.gridy = 0;
    panel_1.setLayout(new BorderLayout(0, 0));

    table = new JTable(model);
    JScrollPane scrollPane = new JScrollPane(table);
    panel_1.add(scrollPane, BorderLayout.CENTER);

    table.setPreferredScrollableViewportSize(new Dimension(0, 150));
    table.setFillsViewportHeight(true);
    table.setAutoCreateRowSorter(true);

    // Set up column sizes.
    initColumnSizes(table);

    setLayout(new BorderLayout(0, 0));

    JSplitPane splitPane = new JSplitPane();
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    add(splitPane);
    jPanelDetail = new JPanel();
    splitPane.setBottomComponent(jPanelDetail);
    splitPane.setTopComponent(panel_1);

    GridBagConstraints gbc_jPanelDetail = new GridBagConstraints();
    gbc_jPanelDetail.insets = new Insets(0, 0, 0, 5);
    gbc_jPanelDetail.fill = GridBagConstraints.BOTH;
    gbc_jPanelDetail.gridx = 1;
    gbc_jPanelDetail.gridy = 3;
    jPanelDetail.setLayout(new BorderLayout(0, 0));
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
            int selectedRow = ((table.getSelectedRow() != -1)
                    ? table.convertRowIndexToModel(table.getSelectedRow())
                    : -1);
            logger.info("ListSelectionListener - selectedRow: " + selectedRow);
            if (selectedRow >= 0) {
                if (jPanelDetail != null) {
                    logger.debug("ListSelectionListener - valueChanged");
                    jPanelDetail.removeAll();
                    recEditor = getEditor(repository.getRecording(EventRecording.class, selectedRow));
                    if (recEditor != null) {
                        jPanelDetail.add(recEditor, BorderLayout.CENTER);
                    }
                    jPanelDetail.revalidate();
                }
            }
        }
    });
    if (repository.getRecordings(EventRecording.class).size() > 0) {
        recEditor = getEditor(repository.getRecording(EventRecording.class, 0));
        jPanelDetail.add(recEditor, BorderLayout.CENTER);
        table.setRowSelectionInterval(0, 0);
    }
    if (model.getRowCount() > 0) {
        table.getRowSorter().toggleSortOrder(0);
        table.setRowSelectionInterval(0, 0);
    }
}

From source file:cz.lidinsky.editor.Editor.java

/**
 *  Create main frame of the editor//from   ww  w . jav a 2s . c om
 */
protected void createMainFrame() {

    // Create and set up the window
    frame = new JFrame("GUI Editor");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // split the main window
    split = new JSplitPane();
    frame.add(split);

    // split the right side
    JSplitPane rightSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    split.setBottomComponent(rightSplit);

    // Add component tree navigator
    treeModel = new TreeModel();
    guiStructureTree = new Tree(treeModel);
    guiStructureTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    guiStructureTree.setDragEnabled(true);
    guiStructureTree.setTransferHandler(new TreeTransferHandler());
    JScrollPane treeScroll = new JScrollPane(guiStructureTree);
    rightSplit.setLeftComponent(treeScroll);
    treeModel.addTreeModelListener(this);

    // add screens component
    split.setLeftComponent(treeModel.createRootVisualComponent());
    treeModel.configureRootVisualComponent();

    // Create file handling class
    file = new FileHandling(frame);
    file.addFileEventListener(treeModel);
    file.addFileEventListener(this);

    // Create edit handling class
    edit = new EditHandling(guiStructureTree);

    // Create layout handling class
    //layout = new LayoutHandling(guiStructureTree);

    // Add property editor table
    propertyTableModel = new KeyValueTableModel();
    propertyTable = new JTable(propertyTableModel);
    propertyTable.setDefaultRenderer(Object.class, new ObjectPropertiesTableRenderer());
    TableCellEditor tableCellEditor = new TableCellEditor();
    propertyTable.setDefaultEditor(Object.class, tableCellEditor);
    guiStructureTree.addTreeSelectionListener(tableCellEditor);
    JScrollPane tableScroll = new JScrollPane(propertyTable);
    rightSplit.setBottomComponent(tableScroll);
    guiStructureTree.addTreeSelectionListener(this);
    propertyTableModel.addTableModelListener(guiStructureTree);

    // Add a link component -> tree
    componentToTreeLink = new ComponentToTreeLink(guiStructureTree);

    // Add a menu
    Menu menuBar = new Menu(settings);
    frame.setJMenuBar(menuBar);
    // Edit menu
    edit.addMenu(menuBar);
}

From source file:com.web.vehiclerouting.optaplanner.common.swingui.SolverAndPersistenceFrame.java

private JComponent createQuickOpenPanel() {
    JSplitPane quickOpenSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, createQuickOpenUnsolvedPanel(),
            createQuickOpenSolvedPanel());
    quickOpenSplitPane.setResizeWeight(0.8);
    return quickOpenSplitPane;
}

From source file:com.google.jstestdriver.ui.MainUI.java

private JFrame buildMainAppFrame() {
    return new JFrame("JSTestDriver Browser Manager") {
        {/*  www  .ja  va  2 s  .  c o m*/
            add(new JSplitPane(JSplitPane.VERTICAL_SPLIT) {
                {
                    setTopComponent(new JPanel(new BorderLayout()) {
                        {
                            add(new JPanel(new BorderLayout()) {
                                {
                                    add(statusBar, NORTH);
                                    add(infoPanel, CENTER);
                                    add(capturedBrowsersPanel, SOUTH);
                                }
                            }, SOUTH);
                        }
                    });
                    setBottomComponent(logPanel);
                }
            });
        }
    };
}

From source file:gui.QTLResultsPanel.java

/** QTLResultsPanel().
 * //from w  ww.j ava2  s  . c  om
 * @param qtlResult = the QTL results to show.
 * @param order = the ordered result data this QTL was created from. 
 */
public QTLResultsPanel(QTLResult qtlResult, OrderedResult order) {
    this.qtlResult = qtlResult;
    this.order = order;

    // Trait listbox
    traitModel = new DefaultListModel<Trait>();
    for (Trait trait : qtlResult.getTraits()) {
        traitModel.addElement(trait);
    }
    traitList = new JList<Trait>(traitModel);
    traitList.addListSelectionListener(this);
    traitList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JScrollPane sp1 = new JScrollPane(traitList);
    sp1.setPreferredSize(new Dimension(125, 50));

    // Details text box
    details = new JTextArea();
    details.setFont(new Font("Monospaced", Font.PLAIN, 11));
    details.setMargin(new Insets(2, 5, 2, 5));
    details.setEditable(false);
    details.setTabSize(6);
    JScrollPane sp4;
    if (AppFrame.tpmmode == AppFrame.TPMMODE_QTL) {
        simpleDetails = new JScrollPane();
        simpleDetails.setFont(new Font("Monospaced", Font.PLAIN, 11));
        simplesplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
        simpleright = new JTextArea();
        simpleright.setFont(new Font("Monospaced", Font.PLAIN, 11));
        simpleright.setMargin(new Insets(2, 5, 2, 5));
        simpleright.setEditable(false);
        simpleright.setTabSize(6);
        simplesplit.setRightComponent(new JScrollPane(simpleright));

        simplesplit.setLeftComponent(simpleDetails);
        sp4 = new JScrollPane(simplesplit);
    } else {
        // TPM MODE NONSNP
        simpleright = new JTextArea();
        simpleright.setFont(new Font("Monospaced", Font.PLAIN, 11));
        simpleright.setMargin(new Insets(2, 5, 2, 5));
        simpleright.setEditable(false);
        sp4 = new JScrollPane(simpleright);
    }

    lodDetails = new JTextArea();
    lodDetails.setFont(new Font("Monospaced", Font.PLAIN, 11));
    lodDetails.setMargin(new Insets(2, 5, 2, 5));
    lodDetails.setEditable(false);
    lodDetails.setTabSize(6);
    JScrollPane sp3 = new JScrollPane(lodDetails);
    JTabbedPane tabs = new JTabbedPane();
    JScrollPane sp2 = new JScrollPane(details);
    tabs.add(sp2, "Full Model");
    tabs.add(sp4, "Simple Model");
    tabs.add(sp3, "LOD Details");

    // The splitpane
    splits = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splits.setTopComponent(new JPanel());
    splits.setBottomComponent(tabs);
    splits.setResizeWeight(0.5);

    // pane2
    JSplitPane splits2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splits2.setLeftComponent(sp1);
    splits2.setRightComponent(splits);

    setLayout(new BorderLayout());
    add(new GradientPanel("QTL Analysis Results"), BorderLayout.NORTH);
    // add(sp1, BorderLayout.WEST);
    // add(splits);
    add(splits2);
    add(toolbar = new QTLResultsToolBar(this), BorderLayout.EAST);
}

From source file:com.employee.scheduler.common.swingui.SolverAndPersistenceFrame.java

private JComponent createQuickOpenPanel() {
    JPanel quickOpenPanel = new JPanel(new BorderLayout());
    quickOpenPanel.add(new JLabel("Quick open"), BorderLayout.NORTH);
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, createQuickOpenUnsolvedPanel(),
            createQuickOpenSolvedPanel());
    splitPane.setResizeWeight(0.8);//from  w w  w . j a v a2s . co  m
    splitPane.setBorder(null);
    quickOpenPanel.add(splitPane, BorderLayout.CENTER);
    return quickOpenPanel;
}