Example usage for javax.swing JSplitPane HORIZONTAL_SPLIT

List of usage examples for javax.swing JSplitPane HORIZONTAL_SPLIT

Introduction

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

Prototype

int HORIZONTAL_SPLIT

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

Click Source Link

Document

Horizontal split indicates the Components are split along the x axis.

Usage

From source file:gui.TraitViewerDialog.java

private JPanel createControls() {
    model = new TraitTableModel();
    for (int i = 0; i < tFile.getNames().size(); i++) {
        model.addRow(new Object[] { i + 1, tFile.getEnabled().get(i), tFile.getNames().get(i) });
    }// www.  j a  v a  2s.c  o m

    table = new JTable(model);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getColumnModel().getColumn(0).setPreferredWidth(13);
    table.getColumnModel().getColumn(1).setPreferredWidth(30);
    table.getColumnModel().getColumn(2).setPreferredWidth(130);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getSelectionModel().addListSelectionListener(this);

    splits = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splits.setLeftComponent(new JScrollPane(table));

    splits.setDividerLocation(250);
    splits.setResizeWeight(0.5);
    splits.setRightComponent(new JPanel());
    JPanel p1 = new JPanel(new BorderLayout());
    p1.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
    p1.add(splits);

    return p1;
}

From source file:edu.wpi.cs.wpisuitetng.modules.requirementsmanager.view.charts.StatView.java

private StatView() {

    chartType = ChartType.PIE;// ww w .  j  a  va  2 s  .c o m
    chartDataType = DataType.STATUS;
    FilterView.getInstance().addFilterUpdateListener(this);

    setLayout(new BorderLayout());
    final JPanel chart = new ChartPanel(StatView.createPieStatusChart());

    final JSplitPane mainPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, chart, buildSidePanel());
    mainPane.setResizeWeight(0.40);
    add(mainPane);
}

From source file:fusion.Fusion.java

private static void initGui() {
    guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    guiFrame.setTitle("Parameters, RDFTree, Data fusion");
    guiFrame.setSize(1200, 800);//from  w ww  .j  a  va  2s .c o m
    guiFrame.setLocationRelativeTo(null);
    //container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
    //guiFrame.add(container);
    split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, null, null);
    guiFrame.add(split);
}

From source file:daylightchart.gui.DaylightChartGui.java

/**
 * Creates a new instance of a Daylight Chart main window.
 *
 * @param location//from  w  ww  .  ja  va  2s . c o m
 *        Location for a single chart window, or null for the full UI
 * @param slimUi
 *        Whether to use a slim user interface
 */
public DaylightChartGui(final Location location, final boolean slimUi) {

    this.slimUi = slimUi;

    setIconImage(new ImageIcon(DaylightChartGui.class.getResource("/daylightchart.png")) //$NON-NLS-1$
            .getImage());

    setTitle("Daylight Chart"); //$NON-NLS-1$
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    if (location == null) {
        // Create basic UI
        locationsTabbedPane = new LocationsTabbedPane();
        locationsList = new LocationsList(this);

        if (slimUi) {
            getContentPane().add(locationsList);
        } else {
            final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, locationsList,
                    locationsTabbedPane);
            splitPane.setOneTouchExpandable(true);
            getContentPane().add(splitPane);
        }

        // Create menus and toolbars
        final JMenuBar menuBar = new JMenuBar();
        setJMenuBar(menuBar);
        final JToolBar toolBar = new JToolBar();
        toolBar.setRollover(true);
        add(toolBar, BorderLayout.NORTH);

        createFileMenu(menuBar, toolBar);
        createActions(menuBar, toolBar);
        createOptionsMenu(menuBar, toolBar);
        createHelpMenu(menuBar, toolBar);

        // Open the first location
        Location firstTabLocation;
        final Collection<Location> recentLocations = UserPreferences.recentLocationsFile().getData();
        if (recentLocations.size() > 0) {
            firstTabLocation = recentLocations.iterator().next();
        } else {
            firstTabLocation = locationsList.getSelectedLocation();
        }
        addLocationTab(firstTabLocation);
    } else {
        locationsTabbedPane = null;
        locationsList = null;
        final DaylightChartReport daylightChartReport = new DaylightChartReport(location,
                UserPreferences.optionsFile().getData());
        final ChartPanel chartPanel = new ChartPanel(daylightChartReport.getChart());
        chartPanel.setPreferredSize(ChartConfiguration.chartDimension);
        setContentPane(chartPanel);
    }

    pack();
}

From source file:gui.QTLResultsPanel.java

/** QTLResultsPanel().
 * /*from   ww w.  jav a  2s. com*/
 * @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:org.datacleaner.widgets.result.UniqueKeyCheckAnalyzerResultSwingRenderer.java

@Override
public JComponent render(UniqueKeyCheckAnalyzerResult result) {
    final int nullCount = result.getNullCount();
    final int nonUniqueCount = result.getNonUniqueCount();

    final DefaultKeyedValues keyedValues = new DefaultKeyedValues();
    keyedValues.addValue("Unique keys", result.getUniqueCount());

    final List<Title> subTitles = new ArrayList<Title>();
    subTitles.add(new ShortTextTitle("Row count: " + result.getRowCount()));
    subTitles.add(new ShortTextTitle("Unique key count: " + result.getUniqueCount()));

    if (nonUniqueCount > 0) {
        keyedValues.addValue("Non-unique keys", nonUniqueCount);
        subTitles.add(new ShortTextTitle("Non-unique key count: " + nonUniqueCount));
    }/*from w  w  w  . ja  v a2 s  .  co  m*/

    final String title;
    if (nullCount == 0) {
        title = "Unique and non-unique keys";
    } else {
        keyedValues.addValue(LabelUtils.NULL_LABEL, nullCount);
        title = "Unique, non-unique and <null> keys";
        subTitles.add(new ShortTextTitle("<null> key count: " + result.getNullCount()));
    }

    final DefaultPieDataset dataset = new DefaultPieDataset(keyedValues);
    final JFreeChart chart = ChartFactory.createRingChart(title, dataset, true, true, false);

    chart.setSubtitles(subTitles);

    ChartUtils.applyStyles(chart);
    ChartPanel chartPanel = ChartUtils.createPanel(chart, false);

    final DCPanel leftPanel = new DCPanel();
    leftPanel.setLayout(new VerticalLayout());
    leftPanel.add(WidgetUtils.decorateWithShadow(chartPanel));

    final Map<String, Integer> samples = result.getNonUniqueSamples();
    if (samples == null || samples.isEmpty()) {
        return leftPanel;
    }

    final DefaultTableModel samplesTableModel = new DefaultTableModel(new String[] { "Key", "Count" }, 0);
    for (final Entry<String, Integer> entry : samples.entrySet()) {
        final String key = entry.getKey();
        final Integer count = entry.getValue();
        samplesTableModel.addRow(new Object[] { key, count });
    }
    final DCTable samplesTable = new DCTable(samplesTableModel);

    final DCPanel rightPanel = new DCPanel();
    rightPanel.setLayout(new BorderLayout());
    rightPanel.add(DCLabel.dark("Sample non-unique keys:"));
    rightPanel.add(samplesTable.toPanel(), BorderLayout.CENTER);

    final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.setOpaque(false);
    split.add(leftPanel);
    split.add(rightPanel);
    split.setDividerLocation(550);

    return split;
}

From source file:edu.unc.LCCC.caBIG.DWD.javaCode.visualization.SetUpPlotWindow.java

public SetUpPlotWindow(String title, int view, double originalMatrix[][], double kde[][], int itemCount1,
        int itemCount2) {
    //super(title);
    this.title = title;
    this.view = view;

    setTitle(title);/*from   w  w  w.  j  a  v a2s  . c  o  m*/

    setLocation(20, 10);
    setSize(450, 450);

    /*The size of each JPanel*/
    int w = 160;
    int h = 140;

    /* Set up the value for PCs*/
    String pc1 = " ";
    String pc2 = " ";
    String pc3 = " ";
    String pc4 = " ";
    if (view == 1 || view == 4 || view == 5) {
        pc1 = "PC1";
        pc2 = "PC2";
        pc3 = "PC3";
        pc4 = "PC4";
    } else if (view == 2 || view == 3) {
        pc1 = "PC1";
        pc2 = "PC2";
        pc3 = "PC3";
        pc4 = "DWD";
    }

    /*initialize the XYDataMatrix */
    XYDataMatrix XYDM = new XYDataMatrix(kde);

    /*The first layer*/
    H13 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H13.setResizeWeight(0.5);
    H13.setOneTouchExpandable(true);

    XYDataset data1 = XYDM.createXYScatterPlotDataset(originalMatrix, 3, 0, itemCount1, itemCount2);
    H13.setRightComponent(createXYScatterPlotChart(data1, pc4, pc1, w, h));

    XYDataset data2 = XYDM.createXYScatterPlotDataset(originalMatrix, 2, 0, itemCount1, itemCount2);
    H13.setLeftComponent(createXYScatterPlotChart(data2, pc3, pc1, w, h));

    H12 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H12.setResizeWeight(0.33);
    H12.setOneTouchExpandable(true);

    XYDataset data3 = XYDM.createXYScatterPlotDataset(originalMatrix, 1, 0, itemCount1, itemCount2);
    H12.setLeftComponent(createXYScatterPlotChart(data3, pc2, pc1, w, h));
    H12.setRightComponent(H13);

    H11 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H11.setResizeWeight(0.25);
    H11.setOneTouchExpandable(true);

    XYDataset data4 = XYDM.createXYLineAndShapeDataset(originalMatrix, kde, 0, itemCount1, itemCount2);
    H11.setLeftComponent(createXYLineAndShapeRendererChart(data4, pc1, "KDE", w, h));
    H11.setRightComponent(H12);

    /*The second layer*/
    H23 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H23.setResizeWeight(0.5);
    H23.setOneTouchExpandable(true);

    XYDataset data5 = XYDM.createXYScatterPlotDataset(originalMatrix, 3, 1, itemCount1, itemCount2);
    H23.setRightComponent(createXYScatterPlotChart(data5, pc4, pc2, w, h));

    XYDataset data6 = XYDM.createXYScatterPlotDataset(originalMatrix, 2, 1, itemCount1, itemCount2);
    H23.setLeftComponent(createXYScatterPlotChart(data6, pc3, pc2, w, h));

    H22 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H22.setResizeWeight(0.33);
    H22.setOneTouchExpandable(true);

    XYDataset data7 = XYDM.createXYLineAndShapeDataset(originalMatrix, kde, 1, itemCount1, itemCount2);
    H22.setLeftComponent(createXYLineAndShapeRendererChart(data7, pc2, "KDE", w, h));

    H22.setRightComponent(H23);

    H21 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H21.setResizeWeight(0.25);
    H21.setOneTouchExpandable(true);

    H21.setLeftComponent(createEmptyPanel(w, h));
    H21.setRightComponent(H22);

    /*The Third layer*/
    H33 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H33.setResizeWeight(0.5);
    H33.setOneTouchExpandable(true);

    XYDataset data9 = XYDM.createXYScatterPlotDataset(originalMatrix, 3, 2, itemCount1, itemCount2);
    H33.setRightComponent(createXYScatterPlotChart(data9, pc4, pc3, w, h));

    XYDataset data10 = XYDM.createXYLineAndShapeDataset(originalMatrix, kde, 2, itemCount1, itemCount2);
    H33.setLeftComponent(createXYLineAndShapeRendererChart(data10, pc3, "KDE", w, h));

    H32 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H32.setResizeWeight(0.33);
    H32.setOneTouchExpandable(true);

    H32.setLeftComponent(createEmptyPanel(w, h));
    H32.setRightComponent(H33);

    H31 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H31.setResizeWeight(0.25);
    H31.setOneTouchExpandable(true);

    H31.setLeftComponent(createEmptyPanel(w, h));
    H31.setRightComponent(H32);

    /*The fourth layer*/
    H43 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H43.setResizeWeight(0.5);
    H43.setOneTouchExpandable(true);

    XYDataset data13 = XYDM.createXYLineAndShapeDataset(originalMatrix, kde, 3, itemCount1, itemCount2);
    H43.setRightComponent(createXYLineAndShapeRendererChart(data13, pc4, "KDE", w, h));
    H43.setLeftComponent(createEmptyPanel(w, h));

    H42 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H42.setResizeWeight(0.33);
    H42.setOneTouchExpandable(true);

    H42.setLeftComponent(createEmptyPanel(w, h));
    H42.setRightComponent(H43);

    H41 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H41.setResizeWeight(0.25);
    H41.setOneTouchExpandable(true);

    H41.setLeftComponent(createEmptyPanel(w, h));
    H41.setRightComponent(H42);

    /*The fifth layer, just a button*/
    //H53 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    //H53.setResizeWeight(0.6);

    //load = new JButton ("Save Frame as .jpeg File To");
    //load.setActionCommand("SAVE2");
    //load.addActionListener(this);

    save = new JButton("Save Frame as .jpeg File To");
    save.setActionCommand("SAVEJPAG");
    save.addActionListener(this);

    //H53.setLeftComponent(load);      
    //H53.setRightComponent(save);

    /*
    H52 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H52.setResizeWeight(0.5);
            
    //JpegOutputFilePath = new JTextField("C:\\DWD\\DWDdata\\" + title +".jpeg" ,30);
    JpegOutputFilePath = new JTextField("" ,30);
    H52.setLeftComponent(JpegOutputFilePath);      
    H52.setRightComponent(H53);
            
    outputFile = new JLabel ("Output File");
    H51 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    H51.setResizeWeight(0.33);
            
    H51.setLeftComponent(outputFile);
    H51.setRightComponent(H52);   
    */

    /*Set H31 to the third layer and H41 to the fourth layer*/
    V4 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    V4.setResizeWeight(0.95);

    V4.setTopComponent(H41);
    //V4.setBottomComponent(H51); 
    //V4.setBottomComponent(H53);
    V4.setBottomComponent(save);

    V3 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    V3.setResizeWeight(0.5);

    V3.setTopComponent(H31);
    V3.setBottomComponent(V4);

    /*Set H21 to the second layer and V3 to the third layer*/
    V2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    V2.setResizeWeight(0.3);

    V2.setTopComponent(H21);
    V2.setBottomComponent(V3);

    /*Set H11 to the first layer and V2 to the second layer*/
    V1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    V1.setResizeWeight(0.25);

    V1.setTopComponent(H11);
    V1.setBottomComponent(V2);

    setContentPane(V1);

    pack();
    setVisible(true);
}

From source file:com.codeasylum.stress.ui.Jormungandr.java

private synchronized Jormungandr init() throws IOException, SAXException, ParserConfigurationException {

    TestPlan testPlan;// w w  w .jav  a 2  s  . co m
    GhostPanel ghostPanel;
    GroupLayout groupLayout;
    ViewPanel viewPanel;
    JTree testTree;
    JSplitPane workSplitPane;
    JScrollPane paletteScrollPane;
    JScrollPane testScrollPane;

    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    exchangeTransport = new ExchangeTransportImpl(exchangeTransportRMIPort);
    menuHandler = new JormungandrMenuHandler(this, menuDelegateFactory);

    testExecutor = new TestExecutor(testPlan = new TestPlan(), exchangeTransport);
    testExecutor.addTestExecutorListener(this);
    testPlan.getRootTask().setName(palette.getAvatar(RootTask.class).getName());

    setGlassPane(ghostPanel = new GhostPanel());
    setLayout(groupLayout = new GroupLayout(getContentPane()));

    testTree = new JTree();
    palettePanel = new PalettePanel(this, ghostPanel, palette);
    testPanel = new TestPanel(this, ghostPanel, palette, viewPanel = new ViewPanel(testTree), testTree);

    paletteScrollPane = new JScrollPane(palettePanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    testScrollPane = new JScrollPane(testPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    workSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, testScrollPane, viewPanel);
    workSplitPane.setDoubleBuffered(true);
    workSplitPane.setContinuousLayout(true);
    workSplitPane.setResizeWeight(0.3);

    groupLayout.setAutoCreateContainerGaps(true);

    groupLayout.setHorizontalGroup(groupLayout.createSequentialGroup()
            .addComponent(paletteScrollPane, (int) palettePanel.getMinimumSize().getWidth() + 3,
                    (int) palettePanel.getPreferredSize().getWidth() + 3,
                    (int) palettePanel.getMaximumSize().getWidth() + 3)
            .addComponent(workSplitPane));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup()
            .addComponent(paletteScrollPane, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
            .addComponent(workSplitPane, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));

    setSize(new Dimension(Math.max(800, ((int) getLayout().preferredLayoutSize(this).getWidth()) + 120),
            Math.min(600, ((int) getLayout().preferredLayoutSize(this).getHeight()) + 38)));
    setLocationByPlatform(true);

    addWindowListener(this);

    return this;
}

From source file:org.eobjects.datacleaner.widgets.result.UniqueKeyCheckAnalyzerResultSwingRenderer.java

@Override
public JComponent render(UniqueKeyCheckAnalyzerResult result) {
    final int nullCount = result.getNullCount();
    final int nonUniqueCount = result.getNonUniqueCount();

    final DefaultKeyedValues keyedValues = new DefaultKeyedValues();
    keyedValues.addValue("Unique keys", result.getUniqueCount());

    final List<Title> subTitles = new ArrayList<Title>();
    subTitles.add(new ShortTextTitle("Row count: " + result.getRowCount()));
    subTitles.add(new ShortTextTitle("Unique key count: " + result.getUniqueCount()));

    if (nonUniqueCount > 0) {
        keyedValues.addValue("Non-unique keys", nonUniqueCount);
        subTitles.add(new ShortTextTitle("Non-unique key count: " + nonUniqueCount));
    }/*from   w  w w . ja va  2  s. c o m*/

    final String title;
    if (nullCount == 0) {
        title = "Unique and non-unique keys";
    } else {
        keyedValues.addValue(LabelUtils.NULL_LABEL, nullCount);
        title = "Unique, non-unique and <null> keys";
        subTitles.add(new ShortTextTitle("<null> key count: " + result.getNullCount()));
    }

    final DefaultPieDataset dataset = new DefaultPieDataset(keyedValues);
    final JFreeChart chart = ChartFactory.createRingChart(title, dataset, true, true, false);

    chart.setSubtitles(subTitles);

    ChartUtils.applyStyles(chart);
    ChartPanel chartPanel = new ChartPanel(chart);

    final DCPanel leftPanel = new DCPanel();
    leftPanel.setLayout(new VerticalLayout());
    leftPanel.add(WidgetUtils.decorateWithShadow(chartPanel, true, 4));

    final Map<String, Integer> samples = result.getNonUniqueSamples();
    if (samples == null || samples.isEmpty()) {
        return leftPanel;
    }

    final DefaultTableModel samplesTableModel = new DefaultTableModel(new String[] { "Key", "Count" }, 0);
    for (final Entry<String, Integer> entry : samples.entrySet()) {
        final String key = entry.getKey();
        final Integer count = entry.getValue();
        samplesTableModel.addRow(new Object[] { key, count });
    }
    final DCTable samplesTable = new DCTable(samplesTableModel);

    final DCPanel rightPanel = new DCPanel();
    rightPanel.setLayout(new BorderLayout());
    rightPanel.add(DCLabel.dark("Sample non-unique keys:"));
    rightPanel.add(samplesTable.toPanel(), BorderLayout.CENTER);

    final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.setOpaque(false);
    split.add(leftPanel);
    split.add(rightPanel);
    split.setDividerLocation(550);

    return split;
}

From source file:org.freeinternals.javaclassviewer.ui.JSplitPaneClassFile.java

private void createAndShowGUI(JFrame top) {

    // Construct class file viewer
    final JTreeClassFile jTreeClassFile = new JTreeClassFile(this.classFile);
    jTreeClassFile.addTreeSelectionListener(new TreeSelectionListener() {
        @Override/*from   w  w  w .ja  v  a 2s.  c  om*/
        public void valueChanged(final javax.swing.event.TreeSelectionEvent evt) {
            jTreeClassFileSelectionChanged(evt);
        }
    });
    final JPanelForTree panel = new JPanelForTree(jTreeClassFile, top);

    final JTabbedPane tabbedPane = new JTabbedPane();

    // Construct binary viewer
    this.binaryViewer = new JBinaryViewer();
    this.binaryViewer.setData(this.classFile.getClassByteArray());
    this.binaryViewerView = new JScrollPane(this.binaryViewer);
    this.binaryViewerView.getVerticalScrollBar().setValue(0);
    tabbedPane.add("Class File", this.binaryViewerView);

    // Construct opcode viewer
    this.opcode = new JTextPane();
    this.opcode.setAlignmentX(Component.LEFT_ALIGNMENT);
    // this.opcode.setFont(new Font(Font.DIALOG_INPUT, Font.PLAIN, 14));
    this.opcode.setEditable(false);
    this.opcode.setBorder(null);
    this.opcode.setContentType("text/html");
    tabbedPane.add("Opcode", new JScrollPane(this.opcode));

    // Class report
    this.report = new JTextPane();
    this.report.setAlignmentX(Component.LEFT_ALIGNMENT);
    this.report.setEditable(false);
    this.report.setBorder(null);
    this.report.setContentType("text/html");
    tabbedPane.add("Report", new JScrollPane(this.report));

    this.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    this.setDividerSize(5);
    this.setDividerLocation(280);
    this.setLeftComponent(panel);
    this.setRightComponent(tabbedPane);

    this.binaryViewerView.getVerticalScrollBar().setValue(0);
}