set Swing Button Standard Size - Java Swing

Java examples for Swing:JButton

Description

set Swing Button Standard Size

Demo Code


import java.awt.Dimension;
import java.lang.String;
import javax.swing.AbstractButton;
import javax.swing.UIManager;

public class Main{
    static final Dimension MULTI_LINE_BUTTON_DIM = UIParameters.INSTANCE
            .getButtonDimension();/*from   ww w .ja v a  2s  .c o m*/
    final static void setStandardSize(AbstractButton button) {
        button.setPreferredSize(ButtonHelper.MULTI_LINE_BUTTON_DIM);
        button.setMaximumSize(ButtonHelper.MULTI_LINE_BUTTON_DIM);
        button.setMinimumSize(ButtonHelper.MULTI_LINE_BUTTON_DIM);
    }
}

Related Tutorials