Example usage for java.awt BorderLayout WEST

List of usage examples for java.awt BorderLayout WEST

Introduction

In this page you can find the example usage for java.awt BorderLayout WEST.

Prototype

String WEST

To view the source code for java.awt BorderLayout WEST.

Click Source Link

Document

The west layout constraint (left side of container).

Usage

From source file:org.nees.rpi.vis.ui.XYChartPanelProxy.java

public XYChartPanelProxy(int width, int height) {
    selectionGroup = new SelectionGroup();
    selectionGroup.setSelection(true);/*  w ww .  j a  v  a  2  s  .co m*/

    dataSet = new XYSeriesCollection();
    chart = ChartFactory.createXYLineChart(null, domainAxisLabel, rangeAxisLabel, dataSet,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.WHITE);
    chart.getLegend().setPosition(RectangleEdge.RIGHT);

    chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(width, height));
    chartPanel.setFillZoomRectangle(true);
    chartPanel.setHorizontalAxisTrace(true);
    chartPanel.setVerticalAxisTrace(true);

    toolPanel = new JPanel();
    toolPanel.setOpaque(false);
    toolPanel.setLayout(new BoxLayout(toolPanel, BoxLayout.Y_AXIS));
    toolPanel.setBorder(BorderFactory.createTitledBorder("Plot Control"));
    toolPanel.setPreferredSize(new Dimension(155, 100));

    chartAreaPanel = new JPanel();
    chartAreaPanel.setOpaque(true);
    chartAreaPanel.setBackground(Color.white);
    chartAreaPanel.setLayout(new BorderLayout());
    chartAreaPanel.add(chartPanel, BorderLayout.CENTER);
    chartAreaPanel.add(toolPanel, BorderLayout.WEST);

    initClearSelectionButton(toolPanel);
    initResetPlotButton(toolPanel);
    initSaveToImageButton(toolPanel);
    initShowAsProfilePlotButton(toolPanel);
}

From source file:pdi.HistogramaRGB.java

private void mostraTela() {
    JFrame f = new JFrame("PDI - Histograma");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.add(criaHistograma(), BorderLayout.EAST);
    f.add(new JLabel(new ImageIcon(imagem)), BorderLayout.WEST);
    f.add(criaPainel(), BorderLayout.SOUTH);
    f.pack();/*from  ww  w . java  2  s. c  om*/
    f.setLocationRelativeTo(f);
    f.setVisible(true);
}

From source file:org.codinjutsu.tools.nosql.redis.view.RedisPanel.java

protected void buildQueryToolBar() {
    toolBarPanel.setLayout(new BorderLayout());

    filterField = new JBTextField("*");
    filterField.setColumns(10);/*from www.j  av a  2 s.c  o m*/

    NonOpaquePanel westPanel = new NonOpaquePanel();

    NonOpaquePanel filterPanel = new NonOpaquePanel();
    filterPanel.add(new JLabel("Filter: "), BorderLayout.WEST);
    filterPanel.add(filterField, BorderLayout.CENTER);
    filterPanel.add(Box.createHorizontalStrut(5), BorderLayout.EAST);
    westPanel.add(filterPanel, BorderLayout.WEST);

    toolBarPanel.add(westPanel, BorderLayout.WEST);

    addCommonsActions();
}

From source file:de.atomfrede.tools.evalutation.ui.ExceptionDialog.java

@Override
public JComponent createContentPanel() {
    // TODO use here nicer layout, maybe with an icon

    JPanel panel = new JPanel(new BorderLayout(10, 10));
    panel.setBorder(BorderFactory.createEmptyBorder(20, 40, 40, 40));

    JLabel label = new JLabel("<html>An error occured!<br/>" + exception.toString() + "</html>");
    label.setHorizontalAlignment(SwingConstants.LEFT);
    panel.add(label, BorderLayout.CENTER);
    panel.add(new JLabel(Icons.IC_DIALOG_ERROR_LARGE), BorderLayout.WEST);
    setSize(panel.getPreferredSize());//  w ww  . jav  a 2  s. co m
    return panel;
}

From source file:gtu._work.ui.StringArrayMakerUI.java

private void initGUI() {
    try {//from w ww  . j a  v  a  2 s .c om
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel1.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(525, 267));
                    {
                        ListModel jList1Model = new DefaultListModel();
                        jList1 = new JList();

                        jScrollPane2.setViewportView(jList1);
                        jList1.addKeyListener(new KeyAdapter() {
                            public void keyPressed(KeyEvent evt) {
                                JListUtil.newInstance(jList1).defaultJListKeyPressed(evt);
                            }
                        });
                        jList1.setModel(jList1Model);
                    }
                }
                {
                    jButton1 = new JButton();
                    jPanel1.add(jButton1, BorderLayout.NORTH);
                    jButton1.setText("\u8cbc\u4e0a");
                    jButton1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton1ActionPerformed(evt);
                        }
                    });
                }
                {
                    jPanel3 = new JPanel();
                    FlowLayout jPanel3Layout = new FlowLayout();
                    jPanel3Layout.setAlignment(FlowLayout.RIGHT);
                    jPanel1.add(jPanel3, BorderLayout.WEST);
                    jPanel3.setLayout(jPanel3Layout);
                    jPanel3.setPreferredSize(new java.awt.Dimension(50, 291));
                    {
                        jCheckBox1 = new JCheckBox();
                        jPanel3.add(jCheckBox1);
                        jCheckBox1.setText("\\n");
                    }
                    {
                        jCheckBox2 = new JCheckBox();
                        jPanel3.add(jCheckBox2);
                        jCheckBox2.setText("\\t");
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    jButton2 = new JButton();
                    jPanel2.add(jButton2, BorderLayout.NORTH);
                    jButton2.setText("\u7522\u751f");
                    jButton2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton2ActionPerformed(evt);
                        }
                    });
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(525, 291));
                    {
                        jTextArea1 = new JTextArea();
                        jScrollPane1.setViewportView(jTextArea1);
                        jTextArea1.setText("");
                    }
                }
            }
        }
        pack();
        this.setSize(546, 382);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:gda.gui.oemove.plugins.UndulatorControl.java

private void createDisplayComponent() {
    displayComponent = new JPanel();
    // JTabbedPane jtp = new JTabbedPane();
    JPanel innerDisplayComponent = new JPanel(new BorderLayout());
    JPanel topPanel = new JPanel(new BorderLayout());
    JPanel changes = new JPanel(new GridLayout(4, 0));
    JPanel current = new JPanel(new BorderLayout());
    JPanel currentLabels = new JPanel(new GridLayout(4, 0));
    JPanel currentFields = new JPanel(new GridLayout(4, 0));

    currentEnergyField = new DefaultDOFPositionDisplay(undulator, "UndulatorEnergy", 15, false);
    currentPolarizationField = new PolarizationDOFPositionDisplay(undulator, "UndulatorPolarization", 15,
            false);//from   w  w  w .j a va 2 s.co  m
    currentHarmonicField = new HarmonicDOFPositionDisplay(undulator, "UndulatorHarmonic", 15, false);

    currentLabels.add(new JLabel(""));
    currentLabels.add(new JLabel("Energy (eV"));
    currentLabels.add(new JLabel("Polarization"));
    currentLabels.add(new JLabel("Harmonic"));
    current.add(currentLabels, BorderLayout.WEST);

    currentFields.add(new JLabel("Current"));
    currentFields.add(currentEnergyField);
    currentFields.add(currentPolarizationField);
    currentFields.add(currentHarmonicField);
    current.add(currentFields, BorderLayout.EAST);
    topPanel.add(current, BorderLayout.WEST);

    energyField = new JTextField(currentEnergyField.getText(), 10);
    polarizationCombo = new PolarizationDOFInputDisplay();
    polarizationCombo.setBorder(null);
    harmonicCombo = new HarmonicDOFInputDisplay();
    harmonicCombo.setBorder(null);
    changes.add(new JLabel("Move to"));
    changes.add(energyField);
    changes.add(polarizationCombo);
    changes.add(harmonicCombo);
    topPanel.add(changes, BorderLayout.EAST);
    topPanel.setBorder(BorderFactory.createEtchedBorder());

    createButtonPanel();
    innerDisplayComponent.add(topPanel, BorderLayout.NORTH);
    innerDisplayComponent.add(buttonPanel, BorderLayout.SOUTH);

    // jtp.addTab("Move", innerDisplayComponent);

    // createViewPanel();
    // DO NOT REMOVE THIS, it is commented out because the viewPanel is
    // still
    // under test
    // jtp.addTab("View", viewPanel);
    // displayComponent.add(jtp);
    displayComponent.add(innerDisplayComponent);
}

From source file:pt.lsts.neptus.console.plugins.planning.VerticalFormationWizard.java

/**
 * @param console//from  www.  j ava2 s  .c  o m
 */
public VerticalFormationWizard(ConsoleLayout console) {
    super(console);
    setLayout(new BorderLayout());
    btnAdvance = new JButton(I18n.text("Next"));
    btnBack = new JButton(I18n.text("Previous"));
    btnCancel = new JButton(I18n.text("Cancel"));

    btnAdvance.addActionListener(this::advance);
    btnBack.addActionListener(this::back);
    btnCancel.addActionListener(this::cancel);

    JPanel btns = new JPanel(new BorderLayout());
    JPanel flow1 = new JPanel(new FlowLayout());
    flow1.add(btnBack);
    JPanel flow2 = new JPanel(new FlowLayout());
    flow2.add(btnCancel);
    flow2.add(btnAdvance);
    btns.add(flow1, BorderLayout.WEST);
    btns.add(flow2, BorderLayout.EAST);
    add(btns, BorderLayout.SOUTH);

    lblTop.setPreferredSize(new Dimension(60, 60));
    lblTop.setMinimumSize(lblTop.getPreferredSize());
    lblTop.setOpaque(true);
    lblTop.setBackground(Color.white);
    lblTop.setFont(new Font("Helvetica", Font.BOLD, 18));
    add(lblTop, BorderLayout.NORTH);

    planSelection = new PlanSelectionPage(console.getMission(), false);
    vehicleSelection = new VehicleSelectionPage(new ArrayList<VehicleType>(), true);

    pages.add(planSelection);
    pages.add(vehicleSelection);
    pages.add(options);
    main = new JPanel(new CardLayout());
    pages.forEach(p -> main.add(p, p.getTitle()));
    add(main, BorderLayout.CENTER);
    lblTop.setText(pages.get(0).getTitle());
}

From source file:task5.Histogram.java

private void display() {
    JFrame f = new JFrame("Histogram");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.add(createChartPanel());//from w  w  w .j  a  v  a  2  s. c o  m
    f.add(createControlPanel(), BorderLayout.SOUTH);
    f.add(new JLabel(new ImageIcon(img)), BorderLayout.WEST);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
}

From source file:MenuItemChooser.java

private void initGUI() {
    JPanel itemDetailsPanel = new JPanel();
    itemDetailsPanel.setLayout(new GridLayout(4, 2));
    itemDetailsPanel.setBackground(Color.WHITE);

    JLabel lbl = new JLabel("Item: ");
    itemDetailsPanel.add(lbl);/*from   ww  w. j av  a  2  s.  c  o m*/

    itemName = new JLabel("");
    itemDetailsPanel.add(itemName);

    lbl = new JLabel("Type: ");
    itemDetailsPanel.add(lbl);

    itemType = new JLabel("");
    itemDetailsPanel.add(itemType);

    lbl = new JLabel("Price: $ ");
    itemDetailsPanel.add(lbl);

    price = new JLabel("");
    itemDetailsPanel.add(price);

    lbl = new JLabel("Quantity: ");
    itemDetailsPanel.add(lbl);

    qty = new JTextField("0", 1);
    qty.addActionListener(this);
    qty.addFocusListener(this);
    itemDetailsPanel.add(qty);

    JPanel imgDescPanel = new JPanel(new BorderLayout());
    imgDescPanel.setBackground(Color.WHITE);
    image = new JLabel("");
    image.setHorizontalAlignment(SwingConstants.CENTER);
    image.setVerticalAlignment(SwingConstants.CENTER);

    imgDescPanel.add(image, BorderLayout.NORTH);

    desc = new JLabel("desc");
    imgDescPanel.add(desc, BorderLayout.SOUTH);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(Color.WHITE);
    next = new JButton("Next");
    next.addActionListener(this);
    buttonPanel.add(next);

    prev = new JButton("Previous");
    prev.addActionListener(this);
    buttonPanel.add(prev);

    order = new JButton("Order");
    order.addActionListener(this);
    buttonPanel.add(order);

    cancel = new JButton("Cancel / New");
    cancel.addActionListener(this);
    buttonPanel.add(cancel);

    close = new JButton("Close");
    close.addActionListener(this);
    close.setEnabled(false);
    buttonPanel.add(close);

    totalLbl = new JLabel("");
    totalLbl.setFont(new Font("Serif", Font.BOLD, 14));
    totalLbl.setForeground((Color.GREEN).darker());
    buttonPanel.add(totalLbl);

    BorderLayout bl = new BorderLayout();
    bl.setHgap(30);
    bl.setVgap(20);
    setLayout(bl);
    setBackground(Color.WHITE);
    add(itemDetailsPanel, BorderLayout.WEST);
    add(imgDescPanel, BorderLayout.EAST);
    add(buttonPanel, BorderLayout.SOUTH);
    TitledBorder title = BorderFactory.createTitledBorder("Choose Menu Items And Place Order");
    setBorder(title);

    loadMenuItem();
}

From source file:net.nosleep.superanalyzer.panels.HomePanel.java

public JPanel createHeaderPanel(JComboBox comboBox, boolean showTagWarning) {

    JPanel panel = new JPanel(new BorderLayout());
    panel.setBackground(Color.WHITE);
    if (comboBox != null) {
        comboBox.setOpaque(false);/*from  w w  w  .j ava2s .  c o  m*/
        panel.add(comboBox, BorderLayout.WEST);
    }

    if (showTagWarning == true)
        panel.add(createWarningPanel(true), BorderLayout.EAST);

    return panel;
}