Java JButton setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight)

Here you can find the source of setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight)

Description

set Empty Border

License

Apache License

Declaration

public static void setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom,
            int paddingRight) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.*;
import javax.swing.border.Border;

public class Main {
    public static void setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom,
            int paddingRight) {
        if (button != null) {
            Border emptyBorder = BorderFactory.createEmptyBorder(paddingTop, paddingLeft, paddingBottom,
                    paddingRight);//from   w ww .  j  a  v  a 2  s .c o  m
            button.setBorder(emptyBorder);
        }
    }
}

Related

  1. removeAllListeners(JButton bouton)
  2. removeMargins(JButton button)
  3. renderImageOnly(JButton button)
  4. setButtonNo(JButton anButton)
  5. setCancelButton(final JRootPane rp, final JButton b)
  6. setEnable(boolean b, JButton... bs)
  7. setImageIcon(JButton b, String fileName, String tip)
  8. setMacBevelButton(JButton button)
  9. setTransparent(JButton btn)