Java JButton Size SetStandardSizeForButton(JButton btn)

Here you can find the source of SetStandardSizeForButton(JButton btn)

Description

Set Standard Size For Button

License

Open Source License

Declaration

public static JButton SetStandardSizeForButton(JButton btn) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.SwingConstants;

public class Main {
    public static JButton SetStandardSizeForButton(JButton btn) {
        btn.setMaximumSize(new Dimension(95, 95));
        btn.setMinimumSize(new Dimension(95, 95));
        btn.setHorizontalTextPosition(SwingConstants.CENTER);
        btn.setVerticalTextPosition(SwingConstants.BOTTOM);
        btn.setFont(new Font("Arial", Font.PLAIN, 10));
        return btn;
    }/*from w ww.j a v  a 2s. co m*/
}

Related

  1. setButtonSize(JButton button, Dimension size)
  2. setButtonSize(JButton button, int width, int height)
  3. setJButtonSizesTheSame(final JButton[] btns)
  4. setJButtonSizesTheSame(JButton[] btns)
  5. setSizes(JButton[] aButtons, Dimension aPreferred, Dimension aMax)