Example usage for javax.swing JButton setHorizontalTextPosition

List of usage examples for javax.swing JButton setHorizontalTextPosition

Introduction

In this page you can find the example usage for javax.swing JButton setHorizontalTextPosition.

Prototype

@BeanProperty(visualUpdate = true, enumerationValues = { "SwingConstants.LEFT", "SwingConstants.CENTER",
        "SwingConstants.RIGHT", "SwingConstants.LEADING",
        "SwingConstants.TRAILING" }, description = "The horizontal position of the text relative to the icon.")
public void setHorizontalTextPosition(int textPosition) 

Source Link

Document

Sets the horizontal position of the text relative to the icon.

Usage

From source file:uk.chromis.pos.forms.JRootApp.java

private void listPeople() {
    try {/*from   w w w  .  j ava 2s  .  co  m*/
        jScrollPane1.getViewport().setView(null);
        JFlowPanel jPeople = new JFlowPanel();
        jPeople.applyComponentOrientation(getComponentOrientation());
        java.util.List people = m_dlSystem.listPeopleVisible();

        for (int i = 0; i < people.size(); i++) {

            AppUser user = (AppUser) people.get(i);
            JButton btn = new JButton(new AppUserAction(user));
            btn.applyComponentOrientation(getComponentOrientation());
            btn.setFocusPainted(false);
            btn.setFocusable(false);
            btn.setRequestFocusEnabled(false);
            btn.setMaximumSize(new Dimension(130, 60));
            btn.setPreferredSize(new Dimension(130, 60));
            btn.setMinimumSize(new Dimension(130, 60));
            btn.setHorizontalAlignment(SwingConstants.CENTER);
            btn.setHorizontalTextPosition(AbstractButton.CENTER);
            btn.setVerticalTextPosition(AbstractButton.BOTTOM);
            jPeople.add(btn);
        }
        jScrollPane1.getViewport().setView(jPeople);

    } catch (BasicException ee) {
    }
}