Example usage for javax.swing JButton getIconTextGap

List of usage examples for javax.swing JButton getIconTextGap

Introduction

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

Prototype

public int getIconTextGap() 

Source Link

Document

Returns the amount of space between the text and the icon displayed in this button.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JButton button = new JButton();
    // Get gap size; default is 4
    int gapSize = button.getIconTextGap();

    // Set gap size
    button.setIconTextGap(8);/*from  w  w  w.j a  v  a  2 s  . co  m*/
}

From source file:Main.java

public static void main(final String args[]) {
    JButton button = new JButton();

    // Get gap size; default is 4
    int gapSize = button.getIconTextGap();

    // Set gap size
    button.setIconTextGap(8);//from   w  w w.  java 2s . com

    JOptionPane.showMessageDialog(null, button);
}