Example usage for javax.swing AbstractButton setIconTextGap

List of usage examples for javax.swing AbstractButton setIconTextGap

Introduction

In this page you can find the example usage for javax.swing AbstractButton setIconTextGap.

Prototype

@BeanProperty(visualUpdate = true, description = "If both the icon and text properties are set, this property defines the space between them.")
public void setIconTextGap(int iconTextGap) 

Source Link

Document

If both the icon and text properties are set, this property defines the space between them.

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JButton("Press Me");
    jb.setIcon(new MyIcon());
    jb.setIconTextGap(50);

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);/*from ww  w.  j av  a 2 s. co  m*/
    f.pack();
    f.setVisible(true);
}