Example usage for javax.swing JButton getMaximumSize

List of usage examples for javax.swing JButton getMaximumSize

Introduction

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

Prototype

@Transient
public Dimension getMaximumSize() 

Source Link

Document

If the maximum size has been set to a non-null value just returns it.

Usage

From source file:org.rimudb.editor.DescriptorEditor.java

/**
 * Create a button for a menu/*w w w  . ja va  2s .  c  o m*/
 */
private JButton createMenuButtonVert(String text) {
    JButton btn = new JButton(text);
    btn.setAlignmentX(CENTER_ALIGNMENT);
    int height = btn.getMaximumSize().height;
    btn.setMaximumSize(new Dimension(Short.MAX_VALUE, height));
    return btn;
}