Example usage for javax.swing AbstractButton setVerticalAlignment

List of usage examples for javax.swing AbstractButton setVerticalAlignment

Introduction

In this page you can find the example usage for javax.swing AbstractButton setVerticalAlignment.

Prototype

@BeanProperty(visualUpdate = true, enumerationValues = { "SwingConstants.TOP", "SwingConstants.CENTER",
        "SwingConstants.BOTTOM" }, description = "The vertical alignment of the icon and text.")
public void setVerticalAlignment(int alignment) 

Source Link

Document

Sets the vertical alignment of the icon and text.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JButton("Press Me");

    jb.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent ev) {
            System.out.println("ChangeEvent!");
        }/*www.j ava 2s  . c  o  m*/
    });
    jb.setVerticalAlignment(20);

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);
    f.pack();
    f.setVisible(true);
}