Here you can find the source of removeMargins(JButton button)
Parameter | Description |
---|---|
button | the button to remove margins and formatting from |
public static void removeMargins(JButton button)
//package com.java2s; //License from project: Open Source License import java.awt.Insets; import javax.swing.JButton; public class Main { /**//from w w w. java 2s . c om * * Removes all extra spacing around the button so other components are layed out right next to it. * * @param button * the button to remove margins and formatting from */ public static void removeMargins(JButton button) { button.setBorder(null); button.setBorderPainted(false); button.setMargin(new Insets(0, 0, 0, 0)); } }