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, Component newLeftComponent, Component newRightComponent) 

Source Link

Document

Creates a new JSplitPane with the specified orientation and the specified components.

Usage

From source file:TestTree4.java

public TestTree4() {
    super("Custom Icon Example");
    setSize(350, 450);//from  w  w  w  . j av  a 2 s.c om
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    // Build the hierarchy of containers & objects
    String[] schoolyard = { "School", "Playground", "Parking Lot", "Field" };
    String[] mainstreet = { "Grocery", "Shoe Shop", "Five & Dime", "Post Office" };
    String[] highway = { "Gas Station", "Convenience Store" };
    String[] housing = { "Victorian_blue", "Faux Colonial", "Victorian_white" };
    String[] housing2 = { "Mission", "Ranch", "Condo" };
    Hashtable homeHash = new Hashtable();
    homeHash.put("Residential 1", housing);
    homeHash.put("Residential 2", housing2);

    Hashtable cityHash = new Hashtable();
    cityHash.put("School grounds", schoolyard);
    cityHash.put("Downtown", mainstreet);
    cityHash.put("Highway", highway);
    cityHash.put("Housing", homeHash);

    Hashtable worldHash = new Hashtable();
    worldHash.put("My First VRML World", cityHash);

    // Build our tree out of our big hashtable
    tree1 = new JTree(worldHash);
    tree2 = new JTree(worldHash);

    DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree2.getCellRenderer();
    renderer.setClosedIcon(new ImageIcon("door.closed.gif"));
    renderer.setOpenIcon(new ImageIcon("door.open.gif"));
    renderer.setLeafIcon(new ImageIcon("world.gif"));

    JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tree1, tree2);

    getContentPane().add(pane, BorderLayout.CENTER);
}

From source file:commonline.query.gui.Frame.java

private void initializeView(ExecuteScriptAction executeScriptAction, Action stopScriptAction) {
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new DatabaseStructurePanel(),
            new QueryPanel(executeScriptAction, stopScriptAction));
    split.setDividerLocation(200);//from   ww  w .java  2 s .  c  om

    getContentPane().add(split, BorderLayout.CENTER);
}

From source file:de.unibayreuth.bayeos.goat.panels.timeseries.JPanelDetailMass.java

/** Creates a new instance of JPanelMassendaten */
public JPanelDetailMass(JMainFrame app) {
    super(app);/*from ww w  .  ja v  a2 s  .  c om*/
    panelChart = new JPanelChart();

    panelMass = new JPanelTableEditMass();
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelChart, panelMass);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(450);
    add(splitPane, BorderLayout.CENTER);
}

From source file:de.unibayreuth.bayeos.goat.panels.timeseries.JPanelDetailLab.java

/** Creates a new instance of JPanelMassendaten */
public JPanelDetailLab(JMainFrame app) {
    super(app);/*  w  w  w  .  j av  a2 s  .c o  m*/
    panelChart = new JPanelChart();
    panelLab = new JPanelTableEditLab();
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelChart, panelLab);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(0.3);
    add(splitPane, BorderLayout.CENTER);
}

From source file:gchisto.gui.panels.gcdistribution.ChartPanelAll.java

/**
 * It creates a chart for the given dataset and adds the chart to the panel.
 *
 * @param dataset The dataset that will provide the values for the chart.
 *//*from ww  w  . j a  va  2s.co m*/
private void addChart(XYDatasetWithGroups dataset) {
    assert dataset != null;

    JFreeChart chart = ChartFactory.createXYAreaChart(getTitle(), "Buckets (sec)", "Count", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    // null so that we can get it compiled; we'll get back to this...
    GroupActivatingPanel table = new GroupActivatingPanel(dataset, null);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, table,
            new org.jfree.chart.ChartPanel(chart));
    splitPane.setDividerLocation(200);
    mainPanel().add(BorderLayout.CENTER, splitPane);
}

From source file:de.unibayreuth.bayeos.goat.panels.timeseries.JPanelDetailMatrix.java

/** Creates a new instance of JPanelMassendaten */
public JPanelDetailMatrix(JMainFrame app) {
    super(app);//from   www .  j a va 2s.  c om
    panelChart = new JPanelChart();
    panelTab = new JPanelTableMatrix();
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelChart, panelTab);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(450);
    add(splitPane, BorderLayout.CENTER);
}

From source file:de.unibayreuth.bayeos.goat.panels.timeseries.JPanelDetailAggr.java

/** Creates a new instance of JPanelMassendaten */
public JPanelDetailAggr(JMainFrame app) {
    super(app);/*  w  ww. j  ava2 s  . co m*/
    panelChart = new JPanelChart();

    panelAggr = new JPanelTable();
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panelChart, panelAggr);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(450);
    add(splitPane, BorderLayout.CENTER);

    hashi = LookUpTableFactory.getHash(LookUpTableFactory.getAggregationsIntervalle());
    hashf = LookUpTableFactory.getHash(LookUpTableFactory.getAggregationsFunktionen());
}

From source file:components.SplitPaneDividerDemo.java

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

    Font font = new Font("Serif", Font.ITALIC, 24);

    ImageIcon icon = createImageIcon("images/Cat.gif");
    SizeDisplayer sd1 = new SizeDisplayer("left", icon);
    sd1.setMinimumSize(new Dimension(30, 30));
    sd1.setFont(font);/* w  w  w .j  av  a2s. c o  m*/

    icon = createImageIcon("images/Dog.gif");
    SizeDisplayer sd2 = new SizeDisplayer("right", icon);
    sd2.setMinimumSize(new Dimension(60, 60));
    sd2.setFont(font);

    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sd1, sd2);
    splitPane.setResizeWeight(0.5);
    splitPane.setOneTouchExpandable(true);
    splitPane.setContinuousLayout(true);

    add(splitPane, BorderLayout.CENTER);
    add(createControlPanel(), BorderLayout.PAGE_END);
}

From source file:SplitPaneTest.java

public SplitPaneFrame() {
    setTitle("SplitPaneTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    // set up components for planet names, images, descriptions

    final JList planetList = new JList(planets);
    final JLabel planetImage = new JLabel();
    final JTextArea planetDescription = new JTextArea();

    planetList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent event) {
            Planet value = (Planet) planetList.getSelectedValue();

            // update image and description

            planetImage.setIcon(value.getImage());
            planetDescription.setText(value.getDescription());
        }//  w  w  w .j a  v a2 s  .  co m
    });

    // set up split panes

    JSplitPane innerPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, planetList, planetImage);

    innerPane.setContinuousLayout(true);
    innerPane.setOneTouchExpandable(true);

    JSplitPane outerPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, innerPane, planetDescription);

    add(outerPane, BorderLayout.CENTER);
}

From source file:components.SplitPaneDemo.java

public SplitPaneDemo() {

    //Create the list of images and put it in a scroll pane.

    list = new JList(imageNames);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);/*from   w w  w  .j  av  a  2 s. c  o  m*/
    list.addListSelectionListener(this);

    JScrollPane listScrollPane = new JScrollPane(list);
    picture = new JLabel();
    picture.setFont(picture.getFont().deriveFont(Font.ITALIC));
    picture.setHorizontalAlignment(JLabel.CENTER);

    JScrollPane pictureScrollPane = new JScrollPane(picture);

    //Create a split pane with the two scroll panes in it.
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, pictureScrollPane);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    //Provide minimum sizes for the two components in the split pane.
    Dimension minimumSize = new Dimension(100, 50);
    listScrollPane.setMinimumSize(minimumSize);
    pictureScrollPane.setMinimumSize(minimumSize);

    //Provide a preferred size for the split pane.
    splitPane.setPreferredSize(new Dimension(400, 200));
    updateLabel(imageNames[list.getSelectedIndex()]);
}