Example usage for javax.swing JSplitPane setTopComponent

List of usage examples for javax.swing JSplitPane setTopComponent

Introduction

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

Prototype

@BeanProperty(bound = false, description = "The component above, or to the left of the divider.")
public void setTopComponent(Component comp) 

Source Link

Document

Sets the component above, or to the left of the divider.

Usage

From source file:uk.ac.babraham.FastQC.Modules.KmerContent.java

public JPanel getResultsPanel() {

    if (!calculated)
        calculateEnrichment();/*  w  ww.j a  v  a2  s .  c om*/
    JPanel returnPanel = new JPanel();
    returnPanel.setLayout(new BorderLayout());
    returnPanel.add(new JLabel("Overrepresented Kmers", JLabel.CENTER), BorderLayout.NORTH);

    JSplitPane splitPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

    if (enrichedKmers.length > 0) {
        TableModel model = new ResultsTable(enrichedKmers);
        splitPanel.setBottomComponent(new JScrollPane(new JTable(model)));
        splitPanel.setTopComponent(new LineGraph(enrichments, minGraphValue, maxGraphValue,
                "Position in read (bp)", xLabels, xCategories, "Log2 Obs/Exp"));
        returnPanel.add(splitPanel, BorderLayout.CENTER);
    } else {
        returnPanel.add(new JLabel("There are no overrepresented Kmers", JLabel.CENTER), BorderLayout.CENTER);
    }

    return returnPanel;
}