Example usage for javax.swing Box setAlignmentX

List of usage examples for javax.swing Box setAlignmentX

Introduction

In this page you can find the example usage for javax.swing Box setAlignmentX.

Prototype

@BeanProperty(description = "The preferred horizontal alignment of the component.")
public void setAlignmentX(float alignmentX) 

Source Link

Document

Sets the horizontal alignment.

Usage

From source file:greenfoot.gui.export.ExportPublishPane.java

/**
 * Build a help box with a link to appropriate help
 * @return help box//  w  w w  .  j  av a 2 s  .c  o  m
 */
private static Box getHelpBox() {
    Box helpBox = new Box(BoxLayout.X_AXIS);
    helpBox.setAlignmentX(LEFT_ALIGNMENT);
    JLabel helpText1 = new JLabel(helpLine1 + " (");
    helpBox.add(helpText1);
    JLabel serverLink = new JLabel(serverURL);
    GreenfootUtil.makeLink(serverLink, serverURL);
    helpBox.add(serverLink);
    helpBox.add(new JLabel(")"));
    return helpBox;
}

From source file:org.jdal.swing.table.TablePanel.java

/**
 * Creates a new Component with FilterView.
 * @return new Component.//  w  w w  .j  a  v a  2  s . com
 */
private Component createFilterBox() {
    Box header = Box.createVerticalBox();

    if (filterView != null) {
        header.add(Box.createVerticalStrut(10));
        filterView.refresh();
        header.add(filterView.getPanel());
    }

    header.setAlignmentX(Container.LEFT_ALIGNMENT);

    return header;
}

From source file:org.jdal.swing.TableEditor.java

/**
 * Creates a new Box with table and actions buttons
 * @return a new Box//from ww  w. java 2  s  . c  o  m
 */
protected Container createTablePanel() {
    table = new JTable(tableModel, tableModel.getTableColumnModel());
    table.setRowHeight(22);
    table.setAutoCreateRowSorter(true);
    tableModel.addTableModelListener(this);
    JScrollPane scroll = new JScrollPane(table);
    scroll.setAlignmentX(Container.LEFT_ALIGNMENT);
    Box box = Box.createVerticalBox();
    JButton addButton = new JButton(new AddAction());
    JButton deleteButton = new JButton(new DeleteAction());
    JButton saveButton = new JButton(new SaveAction());
    JButton refreshButton = new JButton(new RefreshAction());
    Box buttonBox = Box.createHorizontalBox();
    buttonBox.add(addButton);
    buttonBox.add(Box.createHorizontalStrut(5));
    buttonBox.add(deleteButton);
    buttonBox.add(Box.createHorizontalStrut(5));
    buttonBox.add(saveButton);
    buttonBox.add(Box.createHorizontalStrut(5));
    buttonBox.add(refreshButton);
    buttonBox.setAlignmentX(Container.LEFT_ALIGNMENT);
    buttonBox.setMaximumSize(new Dimension(Short.MAX_VALUE, 25));
    box.add(buttonBox);
    box.add(Box.createVerticalStrut(5));
    box.add(scroll);
    return box;
}