Example usage for javax.swing JSplitPane RIGHT

List of usage examples for javax.swing JSplitPane RIGHT

Introduction

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

Prototype

String RIGHT

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

Click Source Link

Document

Used to add a Component to the right of the other Component.

Usage

From source file:org.porphyry.view.Opener.java

public Opener(PortfolioFrame portfolio, String title) {
    super(portfolio, portfolio.localize(title));
    this.portfolio = portfolio;
    this.add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.leftPanel, this.rightPanel));
    Portfolio model = portfolio.getModel();
    try {/* w ww.  j a v  a  2 s .  c o  m*/
        this.populateList(model);
    } catch (Exception e) {
        e.printStackTrace(); //TODO
    }
    this.listView = new JSONList(listModel);
    this.display(this.listView, JSplitPane.RIGHT);

    this.display(new ActionButton("CANCEL", false), JSplitPane.RIGHT);
    this.display(new ActionButton("OPEN", true) {
        @Override
        public void onClick() {
            for (Object o : Opener.this.listView.getSelectedValues()) {
                Opener.this.open(((JSONObject) o).optString("id"), Opener.this.portfolio.getModel());
            }
            super.onClick();
        }
    }, JSplitPane.RIGHT);

    this.setBounds(0, 0, 640, 480);
    this.setVisible(true);
}

From source file:org.porphyry.view.Opener.java

protected void display(Collection<JSONObject> c, String side) throws Exception {
    for (JSONObject o : c) {
        this.display(o.getString("name"), JSplitPane.RIGHT);
    }//from ww  w  .  j a va2s  . co  m
}

From source file:org.porphyry.view.Opener.java

protected void display(Component c, String side) {
    Box panel = (JSplitPane.RIGHT.equals(side)) ? this.rightPanel : this.leftPanel;
    panel.add(c);// w w  w.ja  v  a  2  s. c  o  m
}